SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSPModel_Striping Class Reference

The pedestrian following model. More...

#include <MSPModel_Striping.h>

Inheritance diagram for MSPModel_Striping:
MSPModel

Data Structures

class  by_xpos_sorter
class  MovePedestrians
struct  NextLaneInfo
struct  Obstacle
 information regarding surround Pedestrians (and potentially other things) More...
class  PState
 Container for pedestrian state and individual position update function. More...
struct  WalkingAreaPath

Public Member Functions

PedestrianStateadd (MSPerson *person, MSPerson::MSPersonStage_Walking *stage, SUMOTime now)
 register the given person as a pedestrian
bool blockedAtDist (const MSLane *lane, SUMOReal distToCrossing, std::vector< const MSPerson * > *collectBlockers)
 whether a pedestrian is blocking the crossing of lane at offset distToCrossing
void cleanupHelper ()
 remove state at simulation end
 MSPModel_Striping (const OptionsCont &oc, MSNet *net)
 Constructor (it should not be necessary to construct more than one instance)
 ~MSPModel_Striping ()

Static Public Member Functions

static bool canTraverse (int dir, const std::vector< const MSEdge * > &route)
 return whether the route may traversed with the given starting direction
static void cleanup ()
 remove state at simulation end
static MSPModelgetModel ()
static MSLanegetSidewalk (const MSEdge *edge)
 return the appropriate lane to walk on

Static Public Attributes

static const int BACKWARD
static const int FORWARD
static const SUMOReal SAFETY_GAP
static const SUMOReal SIDEWALK_OFFSET
 the offset for computing person positions when walking on edges without a sidewalk
static const int UNDEFINED_DIRECTION
static SUMOReal stripeWidth
 model parameters
static SUMOReal dawdling
static const SUMOReal LOOKAHEAD_SAMEDIR
static const SUMOReal LOOKAHEAD_ONCOMING
static const SUMOReal LATERAL_PENALTY
static const SUMOReal SQUEEZE
static const SUMOReal BLOCKER_LOOKAHEAD
static const SUMOReal RESERVE_FOR_ONCOMING_FACTOR
static const SUMOReal MAX_WAIT_TOLERANCE
static const SUMOReal LATERAL_SPEED_FACTOR

Protected Types

typedef std::map< const MSLane
*, Pedestrians
ActiveLanes
typedef std::map< const MSLane
*, Obstacles
NextLanesObstacles
typedef std::vector< ObstacleObstacles
typedef std::vector< PState * > Pedestrians
typedef std::map< std::pair
< const MSLane *, const MSLane * >
, WalkingAreaPath
WalkingAreaPaths

Protected Member Functions

const ActiveLanesgetActiveLanes ()
void moveInDirection (SUMOTime currentTime, std::set< MSPerson * > &changedLane, int dir)
 move all pedestrians forward and advance to the next lane if applicable

Private Member Functions

const ObstaclesgetNextLaneObstacles (NextLanesObstacles &nextLanesObs, const MSLane *nextLane, int stripes, SUMOReal nextLength, int nextDir, SUMOReal currentLength, int currentDir)
PedestriansgetPedestrians (const MSLane *lane)
 retrieves the pedestian vector for the given lane (may be empty)

Static Private Member Functions

static int connectedDirection (const MSLane *from, const MSLane *to)
 returns the direction in which these lanes are connectioned or 0 if they are not
static void DEBUG_PRINT (const Obstacles &obs)
static Obstacles getNeighboringObstacles (const Pedestrians &pedestrians, int egoIndex, int stripes)
static NextLaneInfo getNextLane (const PState &ped, const MSLane *currentLane, const MSLane *prevLane)
 computes the successor lane for the given pedestrian and sets the link as well as the direction to use on the succesor lane
static const MSLanegetNextWalkingArea (const MSLane *currentLane, const int dir, MSLink *&link)
 return the next walkingArea in the given direction
static void initWalkingAreaPaths (const MSNet *net)
static Obstacles mergeObstacles (const Obstacles &obs1, const Obstacles &obs2, int dir)
static int numStripes (const MSLane *lane)
 return the maximum number of pedestrians walking side by side

Private Attributes

ActiveLanes myActiveLanes
 store of all lanes which have pedestrians on them
MovePedestriansmyCommand
 the MovePedestrians command that is registered
int myNumActivePedestrians
 the total number of active pedestrians

Static Private Attributes

static WalkingAreaPaths myWalkingAreaPaths
 store for walkinArea elements
static Pedestrians noPedestrians
 empty pedestrian vector

Friends

class GUIPerson

Detailed Description

The pedestrian following model.

Definition at line 57 of file MSPModel_Striping.h.

Member Typedef Documentation

typedef std::map<const MSLane*, Pedestrians> MSPModel_Striping::ActiveLanes
protected

Definition at line 117 of file MSPModel_Striping.h.

typedef std::map<const MSLane*, Obstacles> MSPModel_Striping::NextLanesObstacles
protected

Definition at line 119 of file MSPModel_Striping.h.

typedef std::vector<Obstacle> MSPModel_Striping::Obstacles
protected

Definition at line 118 of file MSPModel_Striping.h.

typedef std::vector<PState*> MSPModel_Striping::Pedestrians
protected

Definition at line 115 of file MSPModel_Striping.h.

typedef std::map<std::pair<const MSLane*, const MSLane*>, WalkingAreaPath> MSPModel_Striping::WalkingAreaPaths
protected

Definition at line 120 of file MSPModel_Striping.h.

Constructor & Destructor Documentation

MSPModel_Striping::MSPModel_Striping ( const OptionsCont oc,
MSNet net 
)
MSPModel_Striping::~MSPModel_Striping ( )

Definition at line 107 of file MSPModel_Striping.cpp.

Member Function Documentation

PedestrianState * MSPModel_Striping::add ( MSPerson person,
MSPerson::MSPersonStage_Walking stage,
SUMOTime  now 
)
virtual

register the given person as a pedestrian

Implements MSPModel.

Definition at line 112 of file MSPModel_Striping.cpp.

References MSPerson::getCurrentStageType(), MSPerson::getEdge(), MSPModel::getSidewalk(), myActiveLanes, myNumActivePedestrians, and MSPerson::WALKING.

bool MSPModel_Striping::blockedAtDist ( const MSLane lane,
SUMOReal  distToCrossing,
std::vector< const MSPerson * > *  collectBlockers 
)
virtual
bool MSPModel::canTraverse ( int  dir,
const std::vector< const MSEdge * > &  route 
)
staticinherited

return whether the route may traversed with the given starting direction

Definition at line 109 of file MSPModel.cpp.

References MSPModel::BACKWARD, MSPModel::FORWARD, MSEdge::getFromJunction(), and MSEdge::getToJunction().

Referenced by MSPModel_Striping::PState::PState().

void MSPModel::cleanup ( )
staticinherited

remove state at simulation end

Definition at line 83 of file MSPModel.cpp.

References MSPModel::cleanupHelper(), and MSPModel::myModel.

Referenced by MSNet::clearAll().

void MSPModel_Striping::cleanupHelper ( )
virtual

remove state at simulation end

Reimplemented from MSPModel.

Definition at line 163 of file MSPModel_Striping.cpp.

References myActiveLanes, myNumActivePedestrians, and myWalkingAreaPaths.

int MSPModel_Striping::connectedDirection ( const MSLane from,
const MSLane to 
)
staticprivate

returns the direction in which these lanes are connectioned or 0 if they are not

Definition at line 176 of file MSPModel_Striping.cpp.

References MSPModel::BACKWARD, MSPModel::FORWARD, MSLinkContHelper::getConnectingLink(), and MSPModel::UNDEFINED_DIRECTION.

Referenced by getNextLane().

void MSPModel_Striping::DEBUG_PRINT ( const Obstacles obs)
staticprivate
const ActiveLanes& MSPModel_Striping::getActiveLanes ( )
inlineprotected

Definition at line 282 of file MSPModel_Striping.h.

References myActiveLanes.

MSPModel * MSPModel::getModel ( )
staticinherited
MSPModel_Striping::NextLaneInfo MSPModel_Striping::getNextLane ( const PState ped,
const MSLane currentLane,
const MSLane prevLane 
)
staticprivate
const MSPModel_Striping::Obstacles & MSPModel_Striping::getNextLaneObstacles ( NextLanesObstacles nextLanesObs,
const MSLane nextLane,
int  stripes,
SUMOReal  nextLength,
int  nextDir,
SUMOReal  currentLength,
int  currentDir 
)
private
const MSLane * MSPModel_Striping::getNextWalkingArea ( const MSLane currentLane,
const int  dir,
MSLink *&  link 
)
staticprivate

return the next walkingArea in the given direction

Definition at line 382 of file MSPModel_Striping.cpp.

References MSPModel::FORWARD, MSLane::getIncomingLanes(), MSLink::getLane(), and MSLane::getLinkCont().

Referenced by getNextLane().

MSPModel_Striping::Pedestrians & MSPModel_Striping::getPedestrians ( const MSLane lane)
private

retrieves the pedestian vector for the given lane (may be empty)

Definition at line 151 of file MSPModel_Striping.cpp.

References myActiveLanes, and noPedestrians.

Referenced by blockedAtDist(), and getNextLaneObstacles().

MSLane * MSPModel::getSidewalk ( const MSEdge edge)
staticinherited

return the appropriate lane to walk on

Definition at line 93 of file MSPModel.cpp.

References MSEdge::getLanes(), and SVC_PEDESTRIAN.

Referenced by add(), getNextLane(), MSPModel_NonInteracting::PState::getPosition(), and initWalkingAreaPaths().

MSPModel_Striping::Obstacles MSPModel_Striping::mergeObstacles ( const Obstacles obs1,
const Obstacles obs2,
int  dir 
)
staticprivate

Definition at line 405 of file MSPModel_Striping.cpp.

Referenced by moveInDirection().

int MSPModel_Striping::numStripes ( const MSLane lane)
staticprivate

Friends And Related Function Documentation

friend class GUIPerson
friend

Definition at line 59 of file MSPModel_Striping.h.

Field Documentation

const SUMOReal MSPModel_Striping::BLOCKER_LOOKAHEAD
static

Definition at line 98 of file MSPModel_Striping.h.

Referenced by blockedAtDist().

SUMOReal MSPModel_Striping::dawdling
static

Definition at line 84 of file MSPModel_Striping.h.

Referenced by MSPModel_Striping(), and MSPModel_Striping::PState::walk().

const SUMOReal MSPModel_Striping::LATERAL_PENALTY
static

Definition at line 92 of file MSPModel_Striping.h.

Referenced by MSPModel_Striping::PState::walk().

const SUMOReal MSPModel_Striping::LATERAL_SPEED_FACTOR
static

Definition at line 107 of file MSPModel_Striping.h.

Referenced by MSPModel_Striping::PState::walk().

const SUMOReal MSPModel_Striping::LOOKAHEAD_ONCOMING
static

Definition at line 89 of file MSPModel_Striping.h.

Referenced by MSPModel_Striping::PState::walk().

const SUMOReal MSPModel_Striping::LOOKAHEAD_SAMEDIR
static

Definition at line 87 of file MSPModel_Striping.h.

Referenced by MSPModel_Striping::PState::walk().

const SUMOReal MSPModel_Striping::MAX_WAIT_TOLERANCE
static

Definition at line 104 of file MSPModel_Striping.h.

Referenced by MSPModel_Striping::PState::getImpatience().

ActiveLanes MSPModel_Striping::myActiveLanes
private

store of all lanes which have pedestrians on them

Definition at line 326 of file MSPModel_Striping.h.

Referenced by add(), cleanupHelper(), getActiveLanes(), getPedestrians(), and moveInDirection().

MovePedestrians* MSPModel_Striping::myCommand
private

the MovePedestrians command that is registered

Definition at line 320 of file MSPModel_Striping.h.

Referenced by MSPModel_Striping().

int MSPModel_Striping::myNumActivePedestrians
private

the total number of active pedestrians

Definition at line 323 of file MSPModel_Striping.h.

Referenced by add(), cleanupHelper(), and moveInDirection().

MSPModel_Striping::WalkingAreaPaths MSPModel_Striping::myWalkingAreaPaths
staticprivate

store for walkinArea elements

Definition at line 329 of file MSPModel_Striping.h.

Referenced by cleanupHelper(), initWalkingAreaPaths(), and MSPModel_Striping::PState::moveToNextLane().

MSPModel_Striping::Pedestrians MSPModel_Striping::noPedestrians
staticprivate

empty pedestrian vector

Definition at line 332 of file MSPModel_Striping.h.

Referenced by getPedestrians().

const SUMOReal MSPModel_Striping::RESERVE_FOR_ONCOMING_FACTOR
static

Definition at line 101 of file MSPModel_Striping.h.

Referenced by MSPModel_Striping::PState::walk().

const SUMOReal MSPModel::SAFETY_GAP
staticinherited

Definition at line 81 of file MSPModel.h.

Referenced by blockedAtDist().

const SUMOReal MSPModel::SIDEWALK_OFFSET
staticinherited

the offset for computing person positions when walking on edges without a sidewalk

Definition at line 84 of file MSPModel.h.

Referenced by MSPModel_NonInteracting::PState::getPosition(), MSPerson::MSPersonStage_Driving::getPosition(), MSPerson::MSPersonStage_Waiting::getPosition(), and GUINet::initGUIStructures().

const SUMOReal MSPModel_Striping::SQUEEZE
static

Definition at line 95 of file MSPModel_Striping.h.

Referenced by MSPModel_Striping::PState::otherStripe().

const int MSPModel::UNDEFINED_DIRECTION
staticinherited

The documentation for this class was generated from the following files: