Xiaofeng Liu
Xiaofeng Liu

Reputation: 31

How can I get vehicle's count in veins 5.0?

In veins 4.7.1 I can have getVehicleCount() in TraciScenarioManger class. But In veins 5.0 this method is not available instead of a protective variable activeVehicleCount. I defined ''' TraCIScenarioManager* Tracscene' ''' but when I use ''' Tracscene->activeVehicleCount ''' I got an error "uint32_t veins::TraCIScenarioManager::activeVehicleCount’ is protected within this context"

How can I solve this problem? Thank you very much!

Upvotes: 1

Views: 74

Answers (1)

Xiaofeng Liu
Xiaofeng Liu

Reputation: 31

Creat a sub class to visit it.

class VEINS_API myTCM : TraCIScenarioManager {
   public:
     int getVehicleCount(){
          return activeVehicleCount;
         }

};

Upvotes: 1

Related Questions