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)

Make sure that the vehicle actually receives the device. You can check this by activating tripinfo output. Every vehicles that has arrived should list all it's device in the tripinfo.

Am So., 15. Dez. 2019 um 21:07 Uhr schrieb WTler <valentin.klamka@xxxxxxxxxxxxxx>:
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/
_______________________________________________
sumo-user mailing list
sumo-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/sumo-user

Back to the top