63 myNet->getBeginOfTimestepEvents()->addEvent(cmd, now + state->
computeDuration(
nullptr, *stage, now));
85 dynamic_cast<PState*
>(state)->getCommand()->abortWalk();
124 if (prev ==
nullptr) {
131 if (next ==
nullptr) {
171 if (lane ==
nullptr) {
248 const MSLane* toLane = stage.
getEdges().back()->getLanes().front();
const L * getSidewalk(const E *edge, SUMOVehicleClass svc=SVC_PEDESTRIAN)
@ SVC_PEDESTRIAN
pedestrian
A road/street connecting two junctions.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
const MSJunction * getToJunction() const
double getLength() const
return the length of the edge
const MSJunction * getFromJunction() const
static bool gLefthand
Whether lefthand-drive is being simulated.
Representation of a lane in the micro simulation.
bool allowsVehicleClass(SUMOVehicleClass vclass) const
The simulated network and simulation perfomer.
Position getPosition(const MSStageMoving &stage, SUMOTime now) const
return the network coordinate of the container
double getAngle(const MSStageMoving &stage, SUMOTime now) const
return the direction in which the container heading to
Position myCurrentBeginPosition
SUMOTime computeDuration(const MSEdge *prev, const MSStageMoving &stage, SUMOTime currentTime)
compute tranship time on edge and update state members
Position myCurrentEndPosition
static const double LATERAL_OFFSET
the offset for computing container positions when being transhiped
CState(MoveToNextEdge *cmd, std::istringstream *in=nullptr)
MSTransportable * myTransportable
MSPModel_NonInteracting * myModel
SUMOTime execute(SUMOTime currentTime)
Executes the command.
implementation of callbacks to retrieve various state information from the model
SUMOTime getEventTime() const
const MSEdge * getNextEdge(const MSStageMoving &stage) const
return the list of internal edges if the transportable is on an intersection
int getDirection() const
return the walking direction (FORWARD, BACKWARD, UNDEFINED_DIRECTION)
SUMOTime myCurrentDuration
double getEdgePos(SUMOTime now) const
abstract methods inherited from PedestrianState
virtual double getAngle(const MSStageMoving &stage, SUMOTime now) const
return the direction in which the transportable faces in degrees
MoveToNextEdge * myCommand
double getSpeed(const MSStageMoving &stage) const
return the current speed of the transportable
virtual Position getPosition(const MSStageMoving &stage, SUMOTime now) const
return the network coordinate of the transportable
virtual SUMOTime computeDuration(const MSEdge *prev, const MSStageMoving &stage, SUMOTime currentTime)
compute walking time on edge and update state members
PState(MoveToNextEdge *cmd, std::istringstream *in=nullptr)
void saveState(std::ostringstream &out)
Saves the current state into the given stream.
MSTransportableStateAdapter * add(MSTransportable *transportable, MSStageMoving *stage, SUMOTime now)
register the given transportable
MSPModel_NonInteracting(const OptionsCont &oc, MSNet *net)
Constructor (it should not be necessary to construct more than one instance).
void remove(MSTransportableStateAdapter *state)
remove the specified person from the pedestrian simulation
~MSPModel_NonInteracting()
void clearState()
Resets pedestrians when quick-loading state.
MSTransportableStateAdapter * loadState(MSTransportable *transportable, MSStageMoving *stage, std::istringstream &in)
load the state of the given transportable
int myNumActivePedestrians
the total number of active pedestrians
MSNet * myNet
the net to which to issue moveToNextEdge commands
static const int BACKWARD
static const double SIDEWALK_OFFSET
the offset for computing person positions when walking on edges without a sidewalk
static const int UNDEFINED_DIRECTION
virtual double getArrivalPos() const
Position getLanePosition(const MSLane *lane, double at, double offset) const
get position on lane at length at with orthogonal offset
double getEdgeAngle(const MSEdge *e, double at) const
get angle of the edge at a certain position
virtual const MSEdge * getNextRouteEdge() const =0
ConstMSEdgeVector getEdges() const
the edges of the current stage
const MSEdge * getEdge() const
Returns the current edge.
double getDepartPos() const
const MSEdge * getFromEdge() const
Returns first edge of the containers route.
virtual double getMaxSpeed(const MSTransportable *const transportable=nullptr) const =0
the maximum speed of the transportable
bool isPerson() const override
Whether it is a person.
abstract base class for managing callbacks to retrieve various state information from the model
A storage for options typed value containers).
A point in 2D or 3D with translation and scaling methods.
Position positionAtOffset2D(double pos, double lateralOffset=0, bool extrapolateBeyond=false) const
Returns the position at the given length.
#define UNUSED_PARAMETER(x)