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

Method crossover

examples/so-bind/example_bind.cpp:100–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98 }
99
100 MySolution crossover(
101 const MySolution& X1,
102 const MySolution& X2,
103 const std::function<double(void)> &rnd01)
104 {
105 MySolution X_new;
106 double r;
107 r=rnd01();
108 X_new.x=r*X1.x+(1.0-r)*X2.x;
109 r=rnd01();
110 X_new.y=r*X1.y+(1.0-r)*X2.y;
111 return X_new;
112 }
113
114 double calculate_SO_total_fitness(const GA_Type::thisChromosomeType &X)
115 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected