| 66 | } |
| 67 | |
| 68 | void TrainingGround::InitialiseAgents(uint16_t populationSize) { |
| 69 | // Create new cars from models loaded in training_car to avoid VIV extract again, each with new RaceNetworks |
| 70 | for (uint16_t pop_Idx = 0; pop_Idx < populationSize; ++pop_Idx) { |
| 71 | shared_ptr<Car> car_agent = std::make_shared<Car>(pop_Idx, this->training_car->all_models, NFS_3, "diab", RaceNet()); |
| 72 | car_agent->colour = glm::vec3(Utils::RandomFloat(0.f, 1.f), Utils::RandomFloat(0.f, 1.f), Utils::RandomFloat(0.f, 1.f)); |
| 73 | physicsEngine.registerVehicle(car_agent); |
| 74 | Renderer::ResetToVroad(1, training_track, car_agent); |
| 75 | car_agents.emplace_back(car_agent); |
| 76 | } |
| 77 | |
| 78 | LOG(INFO) << "Agents initialised"; |
| 79 | } |
| 80 | |
| 81 | void |
| 82 | TrainingGround::SelectAgents(std::vector<shared_ptr<Car>> &car_agents, std::vector<std::vector<int>> agent_fitnesses) { |
nothing calls this directly
no test coverage detected