MCPcopy Create free account
hub / github.com/Arash-codedev/openGA / crossover

Function crossover

examples/so-1/example_so1.cpp:79–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79MySolution crossover(
80 const MySolution& X1,
81 const MySolution& X2,
82 const std::function<double(void)> &rnd01)
83{
84 MySolution X_new;
85 double r;
86 r=rnd01();
87 X_new.x=r*X1.x+(1.0-r)*X2.x;
88 r=rnd01();
89 X_new.y=r*X1.y+(1.0-r)*X2.y;
90 return X_new;
91}
92
93double calculate_SO_total_fitness(const GA_Type::thisChromosomeType &X)
94{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected