Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [sumo-user] Problem getting Parameter of my device(No device of type ' ' exists)

I commented out oc.doRegister and oc.addDescription in insertOptions() for
now. In MSDevice_Car2Car_Energy_Sharing.h I put:

const std::string deviceName() const override {
		return "Car2Car-Energy-Sharing";
	}

and when I type deviceName() in MSDevice_Car2Car_Energy_Sharing.cpp and
select "Go To Definition" it directs me to my header. 
In Python I have: 
print ("energyConsumed:
",traci.vehicle.getParameter(vehID,"device.Car2Car-Energy-Sharing.energyConsumed"))

However there is still the same raised exception as described above.
My Constructor looks as follows:

MSDevice_Car2Car_Energy_Sharing::MSDevice_Car2Car_Energy_Sharing(SUMOVehicle&
holder, const std::string& id, const double actualBatteryCapacity, const
double maximumBatteryCapacity,
	const double powerMax, const double stoppingTreshold, const std::map<int,
double>& param) :
	MSDevice_Battery(holder, id, actualBatteryCapacity, 
maximumBatteryCapacity,
		powerMax, stoppingTreshold, param) {
}

and I made MSDevice_Battery and checkParam in MSDevice_Battery.h public.
So my Constructor calls the Constructor of MSDevice_Battery, might this be a
mistake so that the overriding does not work? If so, how should I do it
instead?



--
Sent from: http://sumo-user-mailing-list.90755.n8.nabble.com/


Back to the top