Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Total Vehicles number in TraCIScenarioManager #247

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/veins/modules/mobility/traci/TraCIScenarioManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ void TraCIScenarioManager::initialize(int stage)
hosts.clear();
subscribedVehicles.clear();
trafficLights.clear();
vehiclesTotalCount = 0;
activeVehicleCount = 0;
parkingVehicleCount = 0;
drivingVehicleCount = 0;
Expand Down Expand Up @@ -796,7 +797,7 @@ void TraCIScenarioManager::processSimSubscription(std::string objectId, TraCIBuf
buf >> idstring;
// adding modules is handled on the fly when entering/leaving the ROI
}

vehiclesTotalCount += count;
activeVehicleCount += count;
drivingVehicleCount += count;
}
Expand Down
3 changes: 2 additions & 1 deletion src/veins/modules/mobility/traci/TraCIScenarioManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ class VEINS_API TraCIScenarioManager : public cSimpleModule, public cISimulation
std::set<std::string> unEquippedHosts;
std::set<std::string> subscribedVehicles; /**< all vehicles we have already subscribed to */
std::map<std::string, cModule*> trafficLights; /**< vector of all traffic lights managed by us */
uint32_t activeVehicleCount; /**< number of vehicles, be it parking or driving **/
uint32_t vehiclesTotalCount; /**< number of total vehicles */
uint32_t activeVehicleCount; /**< number of vehicles, be it parking or driving */
uint32_t parkingVehicleCount; /**< number of parking vehicles, derived from parking start/end events */
uint32_t drivingVehicleCount; /**< number of driving, as reported by sumo */
bool autoShutdownTriggered;
Expand Down