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

Function crossover

examples/mo-1/example_mo1.cpp:70–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70MySolution crossover(
71 const MySolution& X1,
72 const MySolution& X2,
73 const std::function<double(void)> &rnd01)
74{
75 MySolution X_new;
76 double r;
77 r=rnd01();
78 X_new.x=r*X1.x+(1.0-r)*X2.x;
79 r=rnd01();
80 X_new.y=r*X1.y+(1.0-r)*X2.y;
81 return X_new;
82}
83
84std::vector<double> calculate_MO_objectives(const GA_Type::thisChromosomeType &X)
85{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected