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

Method InitialiseAgents

src/RaceNet/TrainingGround.cpp:68–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void 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
81void
82TrainingGround::SelectAgents(std::vector<shared_ptr<Car>> &car_agents, std::vector<std::vector<int>> agent_fitnesses) {

Callers

nothing calls this directly

Calls 3

RaceNetClass · 0.85
RandomFloatFunction · 0.85
registerVehicleMethod · 0.80

Tested by

no test coverage detected