use: followGap = veh->getBackPositionOnLane(following->getLane()) - following->getPositionOnLane() - following->getVehicleType().getMinGap()
This now handles both cases where veh and follower are on the same lane as well as if vehs back is on followers lane. The code does not work if there are lanes in between (but it did not handle that case before either). For that you could use following->getLeader() and use the distance value if the returned leader equals veh. 2016-06-16 20:55 GMT+02:00 Mani Amoozadeh <[email protected]>: > Hi, > > After updating my local sumo code to the latest svn version, I can not > compile it any more. > It seems that getPartialOccupatorEnd() does not exist any more. > Here is my old code that is part of my own car-following model. > > // get the following vehicle > const MSVehicle* following = veh->followVeh->vehiclePtrSumo; > > // make sure, I have a follower > if(following != NULL) > { > followSpeed = following->getSpeed(); > > if (veh == following->getLane()->getPartialOccupator()) > { > followGap = > following->getLane()->getPartialOccupatorEnd() - > following->getPositionOnLane() - following->getVehicleType().getMinGap(); > } > else > { > followGap = veh->getPositionOnLane() - > veh->getVehicleType().getLength() - following->getPositionOnLane() - > following->getVehicleType().getMinGap(); > } > } > > Can you please help me on how I can make the code work again in the > current version of SUMO. Thanks! > > > - Mani > > > ------------------------------------------------------------------------------ > What NetFlow Analyzer can do for you? Monitors network bandwidth and > traffic > patterns at an interface-level. Reveals which users, apps, and protocols > are > consuming the most bandwidth. Provides multi-vendor support for NetFlow, > J-Flow, sFlow and other flows. Make informed decisions using capacity > planning > reports. http://sdm.link/zohomanageengine > _______________________________________________ > sumo-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/sumo-user > ------------------------------------------------------------------------------ What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic patterns at an interface-level. Reveals which users, apps, and protocols are consuming the most bandwidth. Provides multi-vendor support for NetFlow, J-Flow, sFlow and other flows. Make informed decisions using capacity planning reports. http://sdm.link/zohomanageengine _______________________________________________ sumo-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sumo-user
