24 #ifndef MSAbstractLaneChangeModel_h
25 #define MSAbstractLaneChangeModel_h
213 const std::pair<MSVehicle*, SUMOReal>& leader,
214 const std::pair<MSVehicle*, SUMOReal>& neighLead,
215 const std::pair<MSVehicle*, SUMOReal>& neighFollow,
217 const std::vector<MSVehicle::LaneQ>& preb,
237 virtual void changed(
int dir) = 0;
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
The action is done to help someone else.
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.
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.
void initLastLaneChangeOffset(int dir)
The action is due to a TraCI request.
The action is urgent (to be defined by lc-model)
#define UNUSED_PARAMETER(x)
MSAbstractLaneChangeModel & getLaneChangeModel()
MSVehicle * myNeighFollower
The follower on the lane the vehicle want to change to.
static bool myAllowOvertakingRight
whether overtaking on the right is permitted
A class responsible for exchanging messages between cars involved in lane-change interaction.
bool cancelRequest(int state)
whether the influencer cancels the given request
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
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
static void initGlobalOptions(const OptionsCont &oc)
init global model parameters
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.
virtual void saveBlockerLength(SUMOReal length)
reserve space at the end of the lane to avoid dead locks
bool startLaneChangeManeuver(MSLane *source, MSLane *target, int direction)
start the lane change maneuver and return whether it continues
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.
The action is needed to follow the route (navigational lc)
SUMOTime myLastLaneChangeOffset
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.
The action is due to the default of keeping right "Rechtsfahrgebot".
A storage for options typed value containers)
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.
Needs to stay on the current lane.
void resetMoved()
reset the flag whether a vehicle already moved to false
virtual void changed(int dir)=0
virtual void prepareStep()
The vehicle is blocked by right follower.
virtual int wantsChange(int laneOffset, MSAbstractLaneChangeModel::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, MSVehicle **firstBlocked)=0
Called to examine whether the vehicle wants to change using the given laneOffset. This method gets th...
The vehicle is blocked by left leader.
SUMOReal myLaneChangeCompletion
progress of the lane change maneuver 0:started, 1:complete
static MSAbstractLaneChangeModel * build(LaneChangeModel lcm, MSVehicle &vehicle)
Factory method for instantiating new lane changing models.
Representation of a lane in the micro simulation.
const MSCFModel & myCarFollowModel
The vehicle's car following model.
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)
virtual ~MSAbstractLaneChangeModel()
Destructor.