64 throw ProcessError(
"Lane change model '" +
toString(lcm) +
"' is not compatible with sublane simulation");
106 if (neighLeader == 0) {
126 if (leader.first == 0) {
130 if (leader.first->getSpeed() < (80.0 / 3.6)) {
224 std::cout <<
SIMTIME <<
" cleanupShadowLane\n";
231 std::cout <<
SIMTIME <<
" cleanupShadowLane2\n";
233 (*it)->resetPartialOccupation(&
myVehicle);
251 }
else if (dir < 0) {
260 std::cout <<
SIMTIME <<
" updateShadowLane\n";
265 std::vector<MSLane*> passed;
270 assert(further.size() == furtherPosLat.size());
271 for (
int i = (
int)further.size() - 1; i >= 0; --i) {
274 if (shadowFurther != 0) {
275 passed.push_back(shadowFurther);
bool isChangingLanes() const
return true if the vehicle currently performs a lane change maneuver
SUMOReal updateFurtherLanes(std::vector< MSLane *> &furtherLanes, std::vector< SUMOReal > &furtherLanesPosLat, const std::vector< MSLane *> &passedLanes)
update a vector of further lanes and return the new backPos
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.
std::vector< SUMOReal > myShadowFurtherLanesPosLat
virtual bool predInteraction(const std::pair< MSVehicle *, SUMOReal > &leader)
MSLane * getLane() const
Returns the lane the vehicle is on.
SUMOReal getCenterOnEdge() const
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
SUMOReal getSpeedLimit() const
Returns the lane's maximum allowed speed.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
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.
#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.
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.
The vehicle changes lanes (micro only) XXX: What if a vehicle changes lanes and passes a junction sim...
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
virtual void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
void enteredByLaneChange(MSVehicle *v)
std::vector< MSLane * > myShadowFurtherLanes
const std::vector< MSLane * > & getFurtherLanes() const
int myLaneChangeDirection
direction of the lane change maneuver -1 means right, 1 means left
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
virtual SUMOReal setPartialOccupation(MSVehicle *v)
Sets the information about a vehicle lapping into this lane.
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.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
SUMOReal getLateralOverlap() const
return the amount by which the vehicle extends laterally outside it's primary lane ...
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.
void removeShadowApproachingInformation() 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.
SUMOReal getLateralPositionOnLane() const
Get the vehicle's lateral position on the lane.
LaneChangeAction
The state of a vehicle's lane-change behavior.
SUMOTime myLastLaneChangeOffset
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
A storage for options typed value containers)
static SUMOReal gLateralResolution
SUMOReal myLateralspeed
The lateral offset during a continuous LaneChangeManeuver.
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. ...
SUMOReal myLaneChangeCompletion
progress of the lane change maneuver 0:started, 1:complete
int influenceChangeDecision(int state)
allow TraCI to influence a lane change decision
static SUMOTime gLaneChangeDuration
virtual SUMOReal interactionGap(const MSVehicle *const veh, SUMOReal vL) const
Returns the maximum gap at which an interaction between both vehicles occurs.
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
SUMOReal getSpeed() const
Returns the vehicle's current speed.
const std::vector< SUMOReal > & getFurtherLanesPosLat() const
MSAbstractLaneChangeModel(MSVehicle &v, const LaneChangeModel model)
Constructor.
SUMOReal getAngleOffset() const
return the angle offset during a continuous change maneuver
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.