Documentation ¶
Index ¶
- func LinearFloatRange(a, b floatrange.Range) floatrange.Range
- func LinearIntRange(a, b intrange.Range) intrange.Range
- func PointCrossover(a []interface{}, b []interface{}, numPoints int) []interface{}
- func RandomPoints(numPoints int) []float64
- type F
- type FAverageCrossover
- type FPoint
- type FloatRange
- type I
- type IPoint
- type IntRange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LinearFloatRange ¶
func LinearFloatRange(a, b floatrange.Range) floatrange.Range
LinearFloatRange combines two floatranges into a linear range from the average of the minimum and maximum values of the inputs
func LinearIntRange ¶
LinearIntRange combines two intranges into a linear range from the average of the minimum and maximum values of the inputs.
func PointCrossover ¶
func PointCrossover(a []interface{}, b []interface{}, numPoints int) []interface{}
PointCrossover will convert two slices of interfaces into a new slice composed of elements from each slice. This composition will contain long strings of components from each input slice, at the same indices they were at in the original. The number of uninterrupted strings of elements from one slice is noted by numPoints + 1, where numPoints is the number of points the slices are split at.
func RandomPoints ¶
RandomPoints returns a slice of numPoints float64s, randomly distributed from 0.0 to 1.0, but limited so that each point falls somewhere in the 1st, 2nd, etc. portion of the slice as it would be split in to as many parts as there are points.
e.g. 2 points out[0] will be between 0.0 and 0.5 out[1] will be between 0.5 and 1.0wdwdwwwwwwwww
Types ¶
type FAverageCrossover ¶
type FAverageCrossover struct {
AWeight float64
}
type FloatRange ¶
type FloatRange func(a, b floatrange.Range) floatrange.Range
FloatRange represents any function which can crossover floatrange.Range types