24 #include "../MSEdge.h" 25 #include "../MSLane.h" 26 #include "../MSVehicle.h" 39 for (std::vector<MSPushButton*>::const_iterator it = pushButtons.begin(); it != pushButtons.end(); ++it) {
40 if (it.operator * ()->isActivated()) {
61 const std::set<MSTransportable*> persons = walkingEdge->
getPersons();
62 if (persons.size() > 0) {
63 for (std::set<MSTransportable*>::const_iterator pIt = persons.begin(); pIt != persons.end(); ++pIt) {
70 std::ostringstream oss;
71 oss <<
"MSPedestrianPushButton::isActiveForEdge Pushbutton active for edge " << walkingEdge->
getID() <<
" crossing " << crossing->
getID()
80 for (std::vector<MSLane*>::const_iterator laneIt = walkingEdge->
getLanes().begin();
81 laneIt != walkingEdge->
getLanes().end(); ++laneIt) {
84 for (MSLane::VehCont::const_iterator vehicleIt = vehicles.begin(); vehicleIt != vehicles.end(); ++vehicleIt) {
97 std::ostringstream oss;
98 oss <<
"MSPedestrianPushButton::isActiveForEdge Pushbutton active for edge " << walkingEdge->
getID() <<
" crossing " << crossing->
getID()
111 std::ostringstream oss;
112 oss <<
"MSPedestrianPushButton::isActiveForEdge Pushbutton not active for edge " << walkingEdge->
getID() <<
" crossing " << crossing->
getID()
113 <<
" num Persons " << persons.size();
121 void getWalking(
const std::vector<MSEdge*>& edges, std::vector< MSEdge*>& walkingEdges) {
122 for (std::vector<MSEdge*>::const_iterator it = edges.begin(); it != edges.end(); ++it) {
125 walkingEdges.push_back(edge);
132 std::vector<MSEdge*> walkingEdges;
141 for (std::vector<MSEdge*>::const_iterator wIt = walkingList.begin(); wIt != walkingList.end(); ++wIt) {
144 DBG(
WRITE_MESSAGE(
"MSPedestrianPushButton::isActiveOnAnySideOfTheRoad crossing edge " + crossing->
getID() +
" walking edge" + walking->
getID()););
153 std::vector<MSPushButton*> pushButtons;
156 std::set<std::string> controlledEdges;
157 for (std::vector<std::string>::const_iterator lIt = lanes.begin(); lIt != lanes.end(); ++lIt) {
161 if (controlledEdges.count(laneEdge->
getID()) != 0) {
164 controlledEdges.insert(laneEdge->
getID());
171 for (std::vector<MSEdge*>::const_iterator wIt = walkingList.begin(); wIt != walkingList.end(); ++wIt) {
173 DBG(
WRITE_MESSAGE(
"MSPedestrianPushButton::loadPushButtons Added pushButton for walking edge " + walking->
getID() +
" crossing edge " 174 + crossing->
getID() +
" crossed edge " + laneEdge->
getID() +
". Phase state " + phase->
getState()););
188 const MSEdge* edge = *eIt;
190 for (std::vector<std::string>::const_iterator cIt = edge->
getCrossingEdges().begin();
MSEdge & getEdge() const
Returns the lane's edge.
Representation of a vehicle in the micro simulation.
const std::string & getState() const
Returns the state within this phase.
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
SUMOVehicleClass getVClass() const
Returns the vehicle's access class.
bool isWalkingArea() const
return whether this edge is walking area
const MSEdge * getNextEdgePtr() const
returns the next edge ptr if this person is walking and the pedestrian model allows it ...
const std::string & getID() const
returns the id of the transportable
SVCPermissions getPermissions() const
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary...
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
const std::string & getID() const
Returns the id.
A road/street connecting two junctions.
const MSEdgeVector & getPredecessors() const
double getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
std::vector< MSVehicle * > VehCont
Container for vehicles.
static bool dictionary(const std::string &id, MSLane *lane)
Static (sic!) container methods {.
const LaneIdVector & getTargetLaneSet() const
const MSEdge * succEdge(int nSuccs) const
Returns the nSuccs'th successor of edge the vehicle is currently at.
const std::vector< std::string > & getCrossingEdges() const
Gets the crossed edge ids.
static const MSEdgeVector & getAllEdges()
Returns all edges with a numerical id.
const std::set< MSTransportable * > & getPersons() const
Returns this edge's persons set.
bool isCrossing() const
return whether this edge is a pedestrian crossing
const MSEdgeVector & getSuccessors() const
Returns the following edges.
#define WRITE_MESSAGE(msg)
The definition of a single phase of a tls logic.
Representation of a lane in the micro simulation.
const std::string & getID() const
Returns the name of the vehicle.