makingthematrix / gailibrary

A very cheerful library for Artificial Intelligence in games
MIT License
7 stars 0 forks source link

Coeff #12

Open makingthematrix opened 6 years ago

makingthematrix commented 6 years ago

A simple wrapper over floats, with assertions:

There should be a "normalization" method which, given a vector of floats, returns a vector of coeffs where the sum of all coeffs is Coeff(1.0).

Also, utility methods for Coeff(0.0) and Coeff(1.0).

makingthematrix commented 6 years ago

I decided to use a more flexible Coeff struct, working on f64 in the range of <0.0, 1.0>, instead of integers.

When all is done, it would be nice to take a look at newtype_derive and shorten the code.