97 CState* state = myParent.getContainerState();
98 const MSEdge* old = myParent.getEdge();
99 const bool arrived = myParent.moveToNextEdge(myContainer, currentTime);
112 return myCurrentBeginPos + (myCurrentEndPos - myCurrentBeginPos) / myCurrentDuration * (now - myLastEntryTime);
118 const SUMOReal dist = myCurrentBeginPosition.distanceTo2D(myCurrentEndPosition);
142 myLastEntryTime = currentTime;
148 myCurrentBeginPosition = stage.
getLanePosition(fromLane, myCurrentBeginPos, LATERAL_OFFSET);
150 myCurrentEndPosition = stage.
getLanePosition(toLane, myCurrentEndPos, LATERAL_OFFSET);
153 return myCurrentDuration;
~MSCModel_NonInteracting()
MSCModel_NonInteracting(MSNet *net)
Constructor (it should not be necessary to construct more than one instance)
static MSCModel_NonInteracting * myModel
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
SUMOReal getEdgePos(const MSContainer::MSContainerStage_Tranship &stage, SUMOTime now) const
return the offset from the start of the current edge measured in its natural direction ...
const MSEdge * getEdge() const
Returns the current edge.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
SUMOReal getMaxSpeed() const
accessors to be used by MSCModel_NonInteracting
SUMOReal getArrivalPos() const
Position positionAtOffset2D(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
SUMOReal getEdgeAngle(const MSEdge *e, SUMOReal at) const
get angle of the edge at a certain position
The simulated network and simulation perfomer.
SUMOReal getAngle(const MSContainer::MSContainerStage_Tranship &stage, SUMOTime now) const
return the direction in which the container heading to
CState * add(MSTransportable *container, MSContainer::MSContainerStage_Tranship *stage, SUMOTime now)
register the given container as a transhiped container
A road/street connecting two junctions.
Position getLanePosition(const MSLane *lane, SUMOReal at, SUMOReal offset) const
get position on lane at length at with orthogonal offset
static const int BACKWARD
SUMOReal getDepartPos() const
A point in 2D or 3D with translation and scaling methods.
MSNet * myNet
the net to which to issue moveToNextEdge commands
MSEventControl * getBeginOfTimestepEvents()
Returns the event control for events executed at the begin of a time step.
const MSEdge * getFromEdge() const
Returns first edge of the containers route.
virtual SUMOTime addEvent(Command *operation, SUMOTime execTimeStep, AdaptType type)
Adds an Event.
Position getPosition(const MSContainer::MSContainerStage_Tranship &stage, SUMOTime now) const
return the network coordinate of the container
SUMOTime execute(SUMOTime currentTime)
Executes the command.
Patch the time in a way that it is at least as high as the simulation begin time. ...
SUMOTime computeTranshipTime(const MSEdge *prev, const MSContainer::MSContainerStage_Tranship &stage, SUMOTime currentTime)
compute tranship time on edge and update state members
SUMOReal getSpeed(const MSContainer::MSContainerStage_Tranship &stage) const
return the current speed of the container
The container following model for tranship.
const MSEdge * getToEdge() const
Returns last edge of the containers route.
Representation of a lane in the micro simulation.
static const int UNDEFINED_DIRECTION
static MSCModel_NonInteracting * getModel()
static void cleanup()
remove state at simulation end
static const SUMOReal LATERAL_OFFSET
the offset for computing container positions when being transhiped