65 throw ProcessError(
"Lane change model '" +
toString(lcm) +
"' is not compatible with sublane simulation");
115 if (neighLeader == 0) {
135 if (leader.first == 0) {
139 if (leader.first->getSpeed() < (80.0 / 3.6)) {
240 std::cout <<
SIMTIME <<
" cleanupShadowLane\n";
247 std::cout <<
SIMTIME <<
" cleanupShadowLane2\n";
249 (*it)->resetPartialOccupation(&
myVehicle);
267 }
else if (dir < 0) {
276 std::cout <<
SIMTIME <<
" updateShadowLane\n";
281 std::vector<MSLane*> passed;
286 assert(further.size() == furtherPosLat.size());
288 for (
int i = 0; i < (int)further.size(); ++i) {
292 passed.push_back(shadowFurther);
299 std::reverse(passed.begin(), passed.end());
bool isChangingLanes() const
return true if the vehicle currently performs a lane change maneuver
static double gLateralResolution
A lane change model developed by J. Erdmann.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
MSEdge & getEdge() const
Returns the lane's edge.
Representation of a vehicle in the micro simulation.
double myLastLateralGapRight
MSLane * getLane() const
Returns the lane the vehicle is on.
int getShadowDirection() const
return the direction in which the current shadow lane lies
double myLaneChangeCompletion
progress of the lane change maneuver 0:started, 1:complete
Notification
Definition of a vehicle state.
std::string time2string(SUMOTime t)
static bool myLCOutput
whether to record lane-changing
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
double myLateralspeed
The lateral offset during a continuous LaneChangeManeuver.
double getAngleOffset() const
return the angle offset during a continuous change maneuver
static std::string getIDSecure(const T *obj, const std::string &fallBack="NULL")
get an identifier for Named-like object which may be Null
void leftByLaneChange(MSVehicle *v)
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)
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const std::string & getID() const
Returns the id.
virtual bool predInteraction(const std::pair< MSVehicle *, double > &leader)
virtual double setPartialOccupation(MSVehicle *v)
Sets the information about a vehicle lapping into this lane.
#define UNUSED_PARAMETER(x)
SUMOTime remainingTime() const
return whether the vehicle passed the midpoint of a continuous lane change maneuver ...
void enterLaneAtLaneChange(MSLane *enteredLane)
Update when the vehicle enters a new lane in the laneChange step.
#define WRITE_WARNING(msg)
Right blinker lights are switched on.
std::vector< double > myShadowFurtherLanesPosLat
const LaneChangeModel myModel
the type of this model
static bool myAllowOvertakingRight
whether overtaking on the right is permitted
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
void leaveLane(const MSMoveReminder::Notification reason, const MSLane *approachedLane=0)
Update of members if vehicle leaves a new lane in the lane change step or at arrival.
The vehicle changes lanes (micro only)
A lane change model developed by D. Krajzewicz, J. Erdmann et al. between 2004 and 2013...
int getIndex() const
Returns the lane's index.
Left blinker lights are switched on.
bool cancelRequest(int state)
whether the influencer cancels the given request
std::vector< MSLane * > myNoPartiallyOccupatedByShadow
void setSublaneChange(double latDist)
Sets a new sublane-change request.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
virtual void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
double getLateralOverlap() const
return the amount by which the vehicle extends laterally outside it's primary lane ...
double updateFurtherLanes(std::vector< MSLane *> &furtherLanes, std::vector< double > &furtherLanesPosLat, const std::vector< MSLane *> &passedLanes)
update a vector of further lanes and return the new backPos
double getCenterOnEdge() const
void enteredByLaneChange(MSVehicle *v)
std::vector< MSLane * > myShadowFurtherLanes
const std::vector< MSLane * > & getFurtherLanes() const
double getSpeedLimit() const
Returns the lane's maximum allowed speed.
virtual double interactionGap(const MSVehicle *const veh, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
int myLaneChangeDirection
direction of the lane change maneuver -1 means right, 1 means left
bool hasInfluencer() const
bool pastMidpoint() const
return whether the vehicle passed the midpoint of a continuous lane change maneuver ...
static void initGlobalOptions(const OptionsCont &oc)
init global model parameters
void fixPosition()
repair errors in vehicle position after changing between internal edges
void setShadowApproachingInformation(MSLink *link) const
set approach information for the shadow vehicle
int myOwnState
The current state of the vehicle.
virtual bool debugVehicle() const
whether the current vehicles shall be debugged
double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
bool startLaneChangeManeuver(MSLane *source, MSLane *target, int direction)
start the lane change maneuver and return whether it continues
void removeShadowApproachingInformation() const
const std::vector< double > & getFurtherLanesPosLat() const
void primaryLaneChanged(MSLane *source, MSLane *target, int direction)
called once when the vehicles primary lane changes
MSVehicle & myVehicle
The vehicle this lane-changer belongs to.
trigger: the time of the step
Influencer & getInfluencer()
Returns the velocity/lane influencer.
LaneChangeAction
The state of a vehicle's lane-change behavior.
virtual void setOwnState(const int state)
SUMOTime myLastLaneChangeOffset
static MSLink * getConnectingLink(const MSLane &from, const MSLane &to)
Returns the link connecting both lanes Both lanes have to be non-internal; 0 may be returned if no co...
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
A storage for options typed value containers)
The abstract direction of a link.
A lane change model developed by D. Krajzewicz between 2004 and 2010.
Static storage of an output device and its base (abstract) implementation.
void changedToOpposite()
called when a vehicle changes between lanes in opposite directions
bool closeTag()
Closes the most recently opened tag.
void switchOffSignal(int signal)
Switches the given signal off.
void switchOnSignal(int signal)
Switches the given signal on.
std::vector< MSLink * > myApproachedByShadow
links which are approached by the shadow vehicle
MSLane * getShadowLane() const
Returns the lane the vehicles shadow is on during continuous/sublane lane change. ...
double getSpeed() const
Returns the vehicle's current speed.
int influenceChangeDecision(int state)
allow TraCI to influence a lane change decision
double myLastLateralGapLeft
the minimum lateral gaps to other vehicles that were found when last changing to the left and right ...
static SUMOTime gLaneChangeDuration
static const double NO_LATERAL_NEIGHBOR
static MSAbstractLaneChangeModel * build(LaneChangeModel lcm, MSVehicle &vehicle)
Factory method for instantiating new lane changing models.
const std::string & getID() const
Returns the name of the vehicle.
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
MSAbstractLaneChangeModel(MSVehicle &v, const LaneChangeModel model)
Constructor.
Interface for lane-change models.
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
MSLane * getParallelLane(int offset) const
Returns the lane with the given offset parallel to this one or 0 if it does not exist.
virtual bool congested(const MSVehicle *const neighLeader)
void endLaneChangeManeuver(const MSMoveReminder::Notification reason=MSMoveReminder::NOTIFICATION_LANE_CHANGE)
virtual ~MSAbstractLaneChangeModel()
Destructor.