96 CState* state = myParent.getContainerState();
97 const MSEdge* old = myParent.getEdge();
98 const bool arrived = myParent.moveToNextEdge(myContainer, currentTime);
111 return myCurrentBeginPos + (myCurrentEndPos - myCurrentBeginPos) / myCurrentDuration * (now - myLastEntryTime);
117 const double dist = myCurrentBeginPosition.
distanceTo2D(myCurrentEndPosition);
125 double angle = stage.
getEdgeAngle(stage.
getEdge(), getEdgePos(stage, now)) + (myCurrentEndPos < myCurrentBeginPos ? 1.5 *
M_PI : 0.5 *
M_PI);
141 myLastEntryTime = currentTime;
147 myCurrentBeginPosition = stage.
getLanePosition(fromLane, myCurrentBeginPos, LATERAL_OFFSET);
149 myCurrentEndPosition = stage.
getLanePosition(toLane, myCurrentEndPos, LATERAL_OFFSET);
152 return myCurrentDuration;
~MSCModel_NonInteracting()
MSCModel_NonInteracting(MSNet *net)
Constructor (it should not be necessary to construct more than one instance)
static MSCModel_NonInteracting * myModel
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
const MSEdge * getToEdge() const
Returns last edge of the containers route.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
const MSEdge * getFromEdge() const
Returns first edge of the containers route.
Position getLanePosition(const MSLane *lane, double at, double offset) const
get position on lane at length at with orthogonal offset
The simulated network and simulation perfomer.
CState * add(MSTransportable *container, MSContainer::MSContainerStage_Tranship *stage, SUMOTime now)
register the given container as a transhiped container
A road/street connecting two junctions.
static const int BACKWARD
A point in 2D or 3D with translation and scaling methods.
double getDepartPos() const
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.
virtual void addEvent(Command *operation, SUMOTime execTimeStep=-1)
Adds an Event.
double getMaxSpeed() const
accessors to be used by MSCModel_NonInteracting
double getAngle(const MSContainer::MSContainerStage_Tranship &stage, SUMOTime now) const
return the direction in which the container heading to
static const double LATERAL_OFFSET
the offset for computing container positions when being transhiped
double getArrivalPos() const
SUMOTime execute(SUMOTime currentTime)
Executes the command.
double getEdgeAngle(const MSEdge *e, double at) const
get angle of the edge at a certain position
SUMOTime computeTranshipTime(const MSEdge *prev, const MSContainer::MSContainerStage_Tranship &stage, SUMOTime currentTime)
compute tranship time on edge and update state members
const MSEdge * getEdge() const
Returns the current edge.
The container following model for tranship.
double getSpeed(const MSContainer::MSContainerStage_Tranship &stage) const
return the current speed of the container
Position getPosition(const MSContainer::MSContainerStage_Tranship &stage, SUMOTime now) const
return the network coordinate of the container
double getEdgePos(const MSContainer::MSContainerStage_Tranship &stage, SUMOTime now) const
return the offset from the start of the current edge measured in its natural direction ...
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