65 myLastLaneChangeOffset(0),
66 myLaneChangeCompletion(1.0),
67 myLaneChangeDirection(0),
68 myLaneChangeMidpointPassed(false),
69 myAlreadyMoved(false),
72 myCarFollowModel(v.getCarFollowModel()) {
85 if (neighLeader == 0) {
108 if (leader->
getSpeed() < (80.0 / 3.6)) {
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()
SUMOReal getLength() const
Returns the lane's length.
std::string time2string(SUMOTime t)
SUMOReal getLength() const
Get vehicle's length [m].
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
SUMOReal getWidth() const
Returns the lane's width.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
The vehicle got vaporized.
void leftByLaneChange(MSVehicle *v)
virtual bool predInteraction(const MSVehicle *const leader)
MSLane * myShadowLane
The lane the vehicle shadow is on during a continuous lane change.
SUMOReal getPositionOnLane() const
Get the vehicle's position along the lane.
void enterLaneAtLaneChange(MSLane *enteredLane)
Update when the vehicle enters a new lane in the laneChange step.
#define WRITE_WARNING(msg)
A lane change model developed by J. Erdmann.
const std::string & getID() const
Returns the id.
The vehicle changes lanes (micro only)
A lane change model developed by D. Krajzewicz, J. Erdmann et al. between 2004 and 2013...
void continueLaneChangeManeuver(bool moved)
void removeLaneChangeShadow()
remove the shadow copy of a lane change maneuver
virtual SUMOReal interactionGap(const MSVehicle *const veh, SUMOReal vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
SUMOReal getMinGap() const
Get the free space in front of vehicles of this class.
bool myLaneChangeMidpointPassed
whether myLane has already been set to the target of the lane-change maneuver
void enteredByLaneChange(MSVehicle *v)
MSLane * getParallelLane(int offset) const
Returns the lane with the given offset parallel to this one or 0 if it does not exist.
SUMOReal getSpeedLimit() const
Returns the lane's maximum allowed speed.
int myLaneChangeDirection
direction of the lane change maneuver -1 means right, 1 means left
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
bool myAlreadyMoved
whether the vehicle has already moved this step
bool startLaneChangeManeuver(MSLane *source, MSLane *target, int direction)
start the lane change maneuver and return whether it continues
void leaveLane(const MSMoveReminder::Notification reason)
Update of members if vehicle leaves a new lane in the lane change step or at arrival.
SUMOReal getWidth() const
Get the width which vehicles of this class shall have when being drawn.
MSVehicle & myVehicle
The vehicle this lane-changer belongs to.
SUMOTime myLastLaneChangeOffset
information how long ago the vehicle has performed a lane-change
bool fixPosition()
repair errors in vehicle position after changing between internal edges
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
SUMOReal getSpeed() const
Returns the vehicle's current speed.
A lane change model developed by D. Krajzewicz between 2004 and 2010.
MSLane * getLane() const
Returns the lane the vehicle is on.
SUMOReal myLaneChangeCompletion
progress of the lane change maneuver 0:started, 1:complete
static SUMOTime gLaneChangeDuration
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.
Interface for lane-change models.
const std::string & getID() const
Returns the name of the vehicle.
virtual bool congested(const MSVehicle *const neighLeader)
virtual ~MSAbstractLaneChangeModel()
Destructor.