24 #ifndef MSAbstractLaneChangeModel_h
25 #define MSAbstractLaneChangeModel_h
165 const std::pair<MSVehicle*, SUMOReal>& leader,
166 const std::pair<MSVehicle*, SUMOReal>& neighLead,
167 const std::pair<MSVehicle*, SUMOReal>& neighFollow,
169 const std::vector<MSVehicle::LaneQ>& preb,
194 const std::vector<MSVehicle::LaneQ>& preb,
379 virtual bool predInteraction(
const std::pair<MSVehicle*, SUMOReal>& leader);
std::vector< MSLane * > myPartiallyOccupatedByShadow
list of lanes where the shadow vehicle is partial occupator
saves leader/follower vehicles and their distances relative to an ego vehicle
Representation of a vehicle in the micro simulation.
bool isChangingLanes() const
return true if the vehicle currently performs a lane change maneuver
std::vector< SUMOReal > myShadowFurtherLanesPosLat
const std::vector< SUMOReal > & getShadowFurtherLanesPosLat() const
virtual void * inform(void *info, MSVehicle *sender)=0
virtual bool predInteraction(const std::pair< MSVehicle *, SUMOReal > &leader)
MSVehicle * myNeighLeader
The leader on the lane the vehicle want to change to.
virtual bool debugVehicle() const
whether the current vehicles shall be debugged
~MSLCMessager()
Destructor.
bool alreadyChanged() const
reset the flag whether a vehicle already moved to false
The car-following model abstraction.
void * informNeighFollower(void *info, MSVehicle *sender)
Informs the follower on the desired lane.
int getShadowDirection() const
return the direction in which the current shadow lane lies
Notification
Definition of a vehicle state.
static bool myLCOutput
whether to record lane-changing
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)
Called to examine whether the vehicle wants to change using the given laneOffset. This method gets th...
MSLCMessager(MSVehicle *leader, MSVehicle *neighLead, MSVehicle *neighFollow)
Constructor.
MSLane * myShadowLane
A lane that is partially occupied by the front of the vehicle but that is not the primary lane...
void initLastLaneChangeOffset(int dir)
#define UNUSED_PARAMETER(x)
MSAbstractLaneChangeModel & getLaneChangeModel()
virtual int wantsChangeSublane(int laneOffset, const MSLeaderDistanceInfo &leaders, const MSLeaderDistanceInfo &followers, const MSLeaderDistanceInfo &blockers, const MSLeaderDistanceInfo &neighLeaders, const MSLeaderDistanceInfo &neighFollowers, const MSLeaderDistanceInfo &neighBlockers, const MSLane &neighLane, const std::vector< MSVehicle::LaneQ > &preb, MSVehicle **lastBlocked, MSVehicle **firstBlocked, SUMOReal &latDist, int &blocked)
MSVehicle * myNeighFollower
The follower on the lane the vehicle want to change to.
const LaneChangeModel myModel
the type of this model
static bool myAllowOvertakingRight
whether overtaking on the right is permitted
A class responsible for exchanging messages between cars involved in lane-change interaction.
The vehicle changes lanes (micro only) XXX: What if a vehicle changes lanes and passes a junction sim...
bool cancelRequest(int state)
whether the influencer cancels the given request
std::vector< MSLane * > myNoPartiallyOccupatedByShadow
bool pastMidpoint() const
return whether the vehicle passed the midpoint of a continuous lane change maneuver ...
void setShadowPartialOccupator(MSLane *lane)
void setShadowLane(MSLane *lane)
set the shadow lane
virtual void updateExpectedSublaneSpeeds(const MSLeaderInfo &ahead, int sublaneOffset, int laneIndex)
update expected speeds for each sublane of the current edge
SUMOReal getLateralSpeed() const
return the lateral speed of the current lane change maneuver
std::vector< MSLane * > myShadowFurtherLanes
const std::vector< MSLane * > & getShadowFurtherLanes() const
void removeShadowApproachingInformation() const
virtual StateAndDist decideDirection(StateAndDist sd1, StateAndDist sd2) const
decide in which direction to move in case both directions are desirable
virtual void setOwnState(int state)
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 continuous/sublane lane change. ...
int myOwnState
The current state of the vehicle.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
SUMOReal getAngleOffset() const
return the angle offset during a continuous change maneuver
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
void setShadowApproachingInformation(MSLink *link) const
set approach information for the shadow vehicle
void primaryLaneChanged(MSLane *source, MSLane *target, int direction)
called once when the vehicles primary lane changes
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 remainingTime() const
return whether the vehicle passed the midpoint of a continuous lane change maneuver ...
SUMOTime myLastLaneChangeOffset
void setNoShadowPartialOccupator(MSLane *lane)
void * informLeader(void *info, MSVehicle *sender)
Informs the leader on the same lane.
void resetChanged()
reset the flag whether a vehicle already moved to false
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.
SUMOReal myLateralspeed
The lateral offset during a continuous LaneChangeManeuver.
virtual void prepareStep()
void changedToOpposite()
called when a vehicle changes between lanes in opposite directions
StateAndDist(int _state, SUMOReal _latDist, int _dir)
std::vector< MSLink * > myApproachedByShadow
links which are approached by the shadow vehicle
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.
bool myAlreadyChanged
whether the vehicle has already moved this step
const MSCFModel & myCarFollowModel
The vehicle's car following model.
bool myAmOpposite
whether the vehicle is driving in the opposite direction
SUMOTime getLastLaneChangeOffset() const
MSAbstractLaneChangeModel(MSVehicle &v, const LaneChangeModel model)
Constructor.
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)
void endLaneChangeManeuver(const MSMoveReminder::Notification reason=MSMoveReminder::NOTIFICATION_LANE_CHANGE)
virtual ~MSAbstractLaneChangeModel()
Destructor.