| 79 | } |
| 80 | |
| 81 | void |
| 82 | TrainingGround::SelectAgents(std::vector<shared_ptr<Car>> &car_agents, std::vector<std::vector<int>> agent_fitnesses) { |
| 83 | // Clone the best network into the worst 50% |
| 84 | for (uint32_t cull_Idx = agent_fitnesses.size() / 2; cull_Idx < agent_fitnesses.size(); ++cull_Idx) { |
| 85 | for (auto &car_agent : car_agents) { |
| 86 | if (car_agent->populationID == agent_fitnesses[cull_Idx][0]) { |
| 87 | car_agent->carNet = car_agents[agent_fitnesses[0][0]]->carNet; |
| 88 | } |
| 89 | } |
| 90 | } |
| 91 | } |
| 92 | |
| 93 | void TrainingGround::Crossover(RaceNet &a, RaceNet &b) { |
| 94 | // TODO: Actually implement this |
nothing calls this directly
no outgoing calls
no test coverage detected