Hi Fellow SUMO & Traci4Matlab Users,

Thank you Mr. Andres for your continued response for every of my query
concerning traci4matlab.

I found the problem I was having with the:

Error using vehicle.subscribeContext
Argument 'vehID' failed validation ischar.

Error in traci.vehicle.subscribeContext (line 34)
p.parse(vehID, domain, dist, varargin{:})

Error in signalizedControl (line 108)

traci.vehicle.subscribeContext(veh,constants.CMD_GET_VEHICLE_VARIABLE,20,{constants.VAR_WAITING_TIME});

it was because the matlab variables are often cell array type which must be
converted to char type to satisfy the ischar condition when being passed in
the subscribe or subscriptionContext methods.

Therefore, the correct way to do it and not get the failed ischar error is:

veh = '-3801.9';
if ~ischar(veh) %if it is not of char type,
      veh = char(veh); %this line convert to the char type so that the
ischar passing in traci4matlab is satisfied.
end


vehicles = traci.vehicle.getIDList();

if ismember(veh,vehicles)

        traci.vehicle.subscribeContext(veh,constants.CMD_GET_VEHICLE_
VARIABLE,20,{constants.VAR_WAITING_TIME});

end


However, I still have a little challenge with the following lines of code:


veh = '-3801.9';
if ~ischar(veh) %if it is not of char type,
      veh = char(veh); %this line convert to the char type so that the
ischar passing in traci4matlab is satisfied.
end
vehicles = traci.vehicle.getIDList();

if ismember(veh ,vehicles)

                                          traci.vehicle.subscribeContext(
veh ,constants.CMD_GET_VEHICLE_VARIABLE,20,{constants.VAR_WAITING_TIME});

            testVehicleHandle = traci.vehicle.getSubscriptionResults(veh);
            display(testVehicleHandle);

end


which I hoped it should return the waiting time of the vehicle, but it
returned "None" instead. What could I be doing wrongly?

Thank You.

Babangida
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
sumo-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sumo-user

Reply via email to