| 77 | } |
| 78 | |
| 79 | MySolution 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 | |
| 93 | double calculate_SO_total_fitness(const GA_Type::thisChromosomeType &X) |
| 94 | { |
no outgoing calls
no test coverage detected