24 #ifndef MSAbstractLaneChangeModel_h
25 #define MSAbstractLaneChangeModel_h
189 MSLCMessager& msgPass,
int blocked,
190 const std::pair<MSVehicle*, SUMOReal>& leader,
191 const std::pair<MSVehicle*, SUMOReal>& neighLead,
192 const std::pair<MSVehicle*, SUMOReal>& neighFollow,
194 const std::vector<MSVehicle::LaneQ>& preb,
201 MSLCMessager& msgPass,
int blocked,
202 const std::pair<MSVehicle*, SUMOReal>& leader,
203 const std::pair<MSVehicle*, SUMOReal>& neighLead,
204 const std::pair<MSVehicle*, SUMOReal>& neighFollow,
206 const std::vector<MSVehicle::LaneQ>& preb,
MSAbstractLaneChangeModel(MSVehicle &v)
Constructor.
bool myHaveShadow
Wether a vehicle shadow exists.
Representation of a vehicle in the micro simulation.
bool isChangingLanes() const
return true if the vehicle currently performs a lane change maneuver
void endLaneChangeManeuver()
virtual void * inform(void *info, MSVehicle *sender)=0
MSVehicle * myNeighLeader
The leader on the lane the vehicle want to change to.
~MSLCMessager()
Destructor.
The car-following model abstraction.
void * informNeighFollower(void *info, MSVehicle *sender)
Informs the follower on the desired lane.
vehicle doesn't want to change
MSLCMessager(MSVehicle *leader, MSVehicle *neighLead, MSVehicle *neighFollow)
Constructor.
virtual bool predInteraction(const MSVehicle *const leader)
MSLane * myShadowLane
The lane the vehicle shadow is on during a continuous lane change.
The action is due to the wish to follow the route (navigational lc)
MSAbstractLaneChangeModel & getLaneChangeModel()
MSVehicle * myNeighFollower
The follower on the lane the vehicle want to change to.
virtual int wantsChangeToLeft(MSLCMessager &msgPass, int blocked, const std::pair< MSVehicle *, SUMOReal > &leader, const std::pair< MSVehicle *, SUMOReal > &neighLead, const std::pair< MSVehicle *, SUMOReal > &neighFollow, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked)=0
Called to examine whether the vehicle wants to change to left This method gets the information about ...
A class responsible for exchanging messages between cars involved in lane-change interaction.
void continueLaneChangeManeuver(bool moved)
void removeLaneChangeShadow()
remove the shadow copy of a lane change maneuver
bool alreadyMoved() const
reset the flag whether a vehicle already moved to false
bool myLaneChangeMidpointPassed
whether myLane has already been set to the target of the lane-change maneuver
ChangeRequest
Requests set via TraCI.
void setOwnState(int state)
The vehicle is blocked by left follower.
int myLaneChangeDirection
direction of the lane change maneuver -1 means right, 1 means left
virtual int wantsChangeToRight(MSLCMessager &msgPass, int blocked, const std::pair< MSVehicle *, SUMOReal > &leader, const std::pair< MSVehicle *, SUMOReal > &neighLead, const std::pair< MSVehicle *, SUMOReal > &neighFollow, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked)=0
Called to examine whether the vehicle wants to change to right This method gets the information about...
MSLane * getShadowLane() const
Returns the lane the vehicles shadow is on during continuouss lane change.
int myOwnState
The current state of the vehicle.
bool myAlreadyMoved
whether the vehicle has already moved this step
SUMOReal getLaneChangeCompletion() const
return whether the vehicle passed the midpoint of a continuous lane change maneuver ...
LaneChangeAction
A try to store the state of a vehicle's lane-change wish in an int.
bool startLaneChangeManeuver(MSLane *source, MSLane *target, int direction)
start the lane change maneuver and return whether it continues
virtual void requestLaneChange(MSVehicle::ChangeRequest request)
MSAbstractLaneChangeModel & operator=(const MSAbstractLaneChangeModel &s)
Invalidated assignment operator.
MSVehicle & myVehicle
The vehicle this lane-changer belongs to.
void * informNeighLeader(void *info, MSVehicle *sender)
Informs the leader on the desired lane.
SUMOTime myLastLaneChangeOffset
information how long ago the vehicle has performed a lane-change
bool isLaneChangeMidpointPassed() const
return whether the vehicle passed the midpoint of a continuous lane change maneuver ...
void * informLeader(void *info, MSVehicle *sender)
Informs the leader on the same lane.
virtual SUMOReal patchSpeed(const SUMOReal min, const SUMOReal wanted, const SUMOReal max, const MSCFModel &cfModel)=0
Called to adapt the speed in order to allow a lane change.
void resetMoved()
reset the flag whether a vehicle already moved to false
virtual void prepareStep()
The vehicle is blocked by right follower.
The vehicle is blocked by left leader.
SUMOReal myLaneChangeCompletion
progress of the lane change maneuver 0:started, 1:complete
Representation of a lane in the micro simulation.
const MSCFModel & myCarFollowModel
The vehicle's car following model.
virtual void fulfillChangeRequest(MSVehicle::ChangeRequest request)
SUMOTime getLastLaneChangeOffset() const
The vehicle is blocked by right leader.
Interface for lane-change models.
MSVehicle * myLeader
The leader on the informed vehicle's lane.
int getLaneChangeDirection() const
return the direction of the current lane change maneuver
virtual bool congested(const MSVehicle *const neighLeader)
The action is due to the wish to be faster (tactical lc)
MSVehicle::ChangeRequest myChangeRequest
virtual ~MSAbstractLaneChangeModel()
Destructor.