| 89 | } |
| 90 | |
| 91 | MySolution crossover( |
| 92 | const MySolution& X1, |
| 93 | const MySolution& X2, |
| 94 | const std::function<double(void)> &rnd01) |
| 95 | { |
| 96 | MySolution X_new; |
| 97 | for(unsigned long i=0;i<X1.x.size();i++) |
| 98 | { |
| 99 | double r=rnd01(); |
| 100 | X_new.x.push_back(r*X1.x[i]+(1.0-r)*X2.x[i]); |
| 101 | } |
| 102 | return X_new; |
| 103 | } |
| 104 | |
| 105 | double calculate_SO_total_fitness(const GA_Type::thisChromosomeType &X) |
| 106 | { |
nothing calls this directly
no outgoing calls
no test coverage detected