MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / SelectAgents

Method SelectAgents

src/RaceNet/TrainingGround.cpp:81–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void
82TrainingGround::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
93void TrainingGround::Crossover(RaceNet &a, RaceNet &b) {
94 // TODO: Actually implement this

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected