WeightedSelector.NET is a .NET Standard 2 project (which means it should work most anywhere) that lets you assign weights to a set of choices, then make decisions based on each choice's proportion of the total weight.
This is useful for scenarios where choices are made based on complicated but quantifiable factors, or where you need to choose between a number of reasonable choices in a way that appears semi-random. Great examples of the latter case include suggestion engines and game AI.
WeightedSelector.NET's API is easy to pick up and fun to use. In one of the examples, we implement a game AI that decides between attacking, fleeing, and casting a heal spell based on a dynamic "fear" factor... In 6 lines of code!
Check out the getting started guide.
First, install NuGet. Then, install WeightedSelector.NET from the package manager console:
PM> Install-Package Ether.WeightedSelector
WeightedSelector.NET is Copyright © 2014 Brian MacKay, Kinetiq, and other contributors under the MIT license.