Skip to content

Easy to use (but high performance!) weighted selection implementation, in C#.

License

Notifications You must be signed in to change notification settings

kinetiq/Ether.WeightedSelector

Repository files navigation

What is WeightedSelector.NET?

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!

How can I get started?

Check out the getting started guide.

Where can I get it?

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.

About

Easy to use (but high performance!) weighted selection implementation, in C#.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages