|
From: Daniel K. <d.k...@go...> - 2010-10-20 08:56:51
|
Dear Lei, Well, there is no member "pred" in the MSVehicle class, so you probably have to compute it by yourself. Are you planning to implement this directly in the c++ code? Then you may go along the lane's (MSLane) vehicles (MSLane::myVehicles) and find the predecessor for a vehicle. sincerely, Daniel 2010/10/18 Lei Chenxi <che...@ya...>: > Dear Daniel, > Thanks for your answer. I would like to implement a vehicle-tracking > algorithm initially on a single straight lane, therefore I need to know > whether I can directly use such as the "pred" (object of the class "vehicle" > defined in MSVehicle) and correspondent functions such as "gap2pred". I > guess your answer is yes. > > > > Best regards, > > Chenxi > > ________________________________ > From: Daniel Krajzewicz <d.k...@go...> > To: Lei Chenxi <che...@ya...> > Cc: sum...@li... > Sent: Mon, October 18, 2010 4:13:51 PM > Subject: Re: [sumo-user] question on MSVehicle::gap2pred > > Dear Lei, > > vehicles are stored in a lane-internal container (I think called > myVehicles). They are sorted by their position, starting with the last > (the one at the begin of the lane) vehicle. During the simulation, the > items of this container are iterated and as they are sorted, you can > get the leader (pred) at the iterator+1 position. > This of course does not hold for the first vehicle on the lane (the > one at the lane's end). Actually, even the other vehicles have to > iterate over the succeeding lanes to determine whether there is a > leader on their successive lanes. This is done by iterating over the > lanes-vector stored in the "bestlanes" (LaneQ) structure of the > vehicle's current lane. Also, the links and internal lanes must be > taken into account. Probably the best way for getting an insight is to > take a look at MSVehicle::vsafeCriticalCont() > > What do you want to achieve? > > sincerely, > Daniel > > > > 2010/10/11 Lei Chenxi <che...@ya...>: >> Hello everyone, >> I have a question on 'pred' of the "MSVehicle::gap2pred". Since 'pred' is >> defined as the closest preceding vehicle, how can sumo itself identify >> which >> vehicle should be 'pred'? If it can, please tell me where the >> correspondent code >> is. Or should I write an algorithm myself to identify that? >> >> >> Thanks. >> Best regards, >> Chenxi >> >> >> >> >> ------------------------------------------------------------------------------ >> Beautiful is writing same markup. Internet Explorer 9 supports >> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. >> Spend less time writing and rewriting code and more time creating great >> experiences on the web. Be a part of the beta today. >> http://p.sf.net/sfu/beautyoftheweb >> _______________________________________________ >> sumo-user mailing list >> sum...@li... >> https://lists.sourceforge.net/lists/listinfo/sumo-user >> > > |