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());
static double gLateralResolution
A lane change model developed by J. Erdmann.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
double getSpeedLimit() const
Returns the lane's maximum allowed speed.
MSEdge & getEdge() const
Returns the lane's edge.
Representation of a vehicle in the micro simulation.
const std::vector< double > & getFurtherLanesPosLat() const
double getCenterOnEdge() const
double myLastLateralGapRight
bool isChangingLanes() const
return true if the vehicle currently performs a lane change maneuver
bool hasInfluencer() const
virtual bool debugVehicle() const
whether the current vehicles shall be debugged
virtual double interactionGap(const MSVehicle *const veh, double vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
double myLaneChangeCompletion
progress of the lane change maneuver 0:started, 1:complete
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
int getShadowDirection() const
return the direction in which the current shadow lane lies
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.
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)
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)
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
const std::string & getID() const
Returns the id.
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...
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.
double getAngleOffset() const
return the angle offset during a continuous change maneuver
bool pastMidpoint() const
return whether the vehicle passed the midpoint of a continuous lane change maneuver ...
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.
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.
std::vector< MSLane * > myShadowFurtherLanes
void removeShadowApproachingInformation() const
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
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. ...
void fixPosition()
repair errors in vehicle position after changing between internal edges
int myOwnState
The current state of the vehicle.
int getIndex() const
Returns the lane's index.
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
MSVehicle & myVehicle
The vehicle this lane-changer belongs to.
const std::vector< MSLane * > & getFurtherLanes() const
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 remainingTime() const
return whether the vehicle passed the midpoint of a continuous lane change maneuver ...
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)
double getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
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
double getLateralOverlap() const
return the amount by which the vehicle extends laterally outside it's primary lane ...
MSLane * getLane() const
Returns the lane the vehicle is on.
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.
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.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
const std::string & getID() const
Returns the name of the vehicle.
virtual bool congested(const MSVehicle *const neighLeader)
double getSpeed() const
Returns the vehicle's current speed.
void endLaneChangeManeuver(const MSMoveReminder::Notification reason=MSMoveReminder::NOTIFICATION_LANE_CHANGE)
virtual ~MSAbstractLaneChangeModel()
Destructor.