Download third_party/CityFlow/src/flow/flow.cpp from Aditya2162/agentic-traffic: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/Aditya2162/agentic-traffic/resolve/main/third_party/CityFlow/src/flow/flow.cpp
- Command line
-
hf download hf://Aditya2162/agentic-traffic/third_party/CityFlow/src/flow/flow.cpp
-
curl -L -o flow.cpp https://huggingface.co/Aditya2162/agentic-traffic/resolve/main/third_party/CityFlow/src/flow/flow.cpp
1.02 kB
| namespace CityFlow { | |
| void Flow::nextStep(double timeInterval) { | |
| if (!valid) return; | |
| if (endTime != -1 && currentTime > endTime) return; | |
| if (currentTime >= startTime) { | |
| while (nowTime >= interval) { | |
| Vehicle* vehicle = new Vehicle(vehicleTemplate, id + "_" + std::to_string(cnt++), engine, this); | |
| int priority = vehicle->getPriority(); | |
| while (engine->checkPriority(priority)) priority = engine->rnd(); | |
| vehicle->setPriority(priority); | |
| engine->pushVehicle(vehicle, false); | |
| vehicle->getFirstRoad()->addPlanRouteVehicle(vehicle); | |
| nowTime -= interval; | |
| } | |
| nowTime += timeInterval; | |
| } | |
| currentTime += timeInterval; | |
| } | |
| std::string Flow::getId() const { | |
| return id; | |
| } | |
| void Flow::reset() { | |
| nowTime = interval; | |
| currentTime = 0; | |
| cnt = 0; | |
| } | |
| } |