SUMO - Simulation of Urban MObility
MSDevice_Person Class Reference

#include <MSDevice_Person.h>

Inheritance diagram for MSDevice_Person:
MSDevice MSMoveReminder Named

Public Types

enum  Notification {
  NOTIFICATION_DEPARTED, NOTIFICATION_JUNCTION, NOTIFICATION_SEGMENT, NOTIFICATION_LANE_CHANGE,
  NOTIFICATION_TELEPORT, NOTIFICATION_PARKING, NOTIFICATION_ARRIVED, NOTIFICATION_VAPORIZED,
  NOTIFICATION_TELEPORT_ARRIVED
}
 Definition of a vehicle state. More...

Public Member Functions

void addPerson (MSPerson *person)
 Add a passenger.
virtual void generateOutput () const
 Called on writing tripinfo output.
SUMOVehiclegetHolder () const
 Returns the vehicle that holds this device.
const std::string & getID () const
 Returns the id.
const MSLanegetLane () const
 Returns the lane the reminder works on.
virtual void notifyMoveInternal (SUMOVehicle &veh, SUMOReal timeOnLane, SUMOReal speed)
 Internal notification about the vehicle moves.
void setID (const std::string &newID)
 resets the id
 ~MSDevice_Person ()
 Destructor.
Methods called on vehicle movement / state change, overwriting MSDevice
bool notifyMove (SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
 Checks whether the vehicle is at a stop and person action is needed.
bool notifyEnter (SUMOVehicle &veh, MSMoveReminder::Notification reason)
 Adds passengers on vehicle insertion.
bool notifyLeave (SUMOVehicle &veh, SUMOReal lastPos, MSMoveReminder::Notification reason)
 Passengers leaving on arrival.

Static Public Member Functions

static MSDevice_PersonbuildVehicleDevices (SUMOVehicle &v, std::vector< MSDevice * > &into)
 Build devices for the given vehicle, if needed.

Protected Attributes

SUMOVehiclemyHolder
 The vehicle that stores the device.
std::string myID
 The name of the object.
MSLane *const myLane
 Lane on which the reminder works.

Private Member Functions

 MSDevice_Person (SUMOVehicle &holder, const std::string &id)
 Constructor.
 MSDevice_Person (const MSDevice_Person &)
 Invalidated copy constructor.
MSDevice_Personoperator= (const MSDevice_Person &)
 Invalidated assignment operator.

Private Attributes

std::vector< MSPerson * > myPersons
 The passengers of the vehicle.
bool myStopped
 whether the vehicle is at a stop

Detailed Description

See also:
MSDevice

Definition at line 57 of file MSDevice_Person.h.


Member Enumeration Documentation

enum MSMoveReminder::Notification [inherited]

Definition of a vehicle state.

Enumerator:
NOTIFICATION_DEPARTED 

The vehicle has departed (was inserted into the network)

NOTIFICATION_JUNCTION 

The vehicle arrived at a junction.

NOTIFICATION_SEGMENT 

The vehicle changes the segment (meso only)

NOTIFICATION_LANE_CHANGE 

The vehicle changes lanes (micro only)

NOTIFICATION_TELEPORT 

The vehicle is being teleported.

NOTIFICATION_PARKING 

The vehicle starts or ends parking.

NOTIFICATION_ARRIVED 

The vehicle arrived at its destination (is deleted)

NOTIFICATION_VAPORIZED 

The vehicle got vaporized.

NOTIFICATION_TELEPORT_ARRIVED 

The vehicle was teleported out of the net.

Definition at line 93 of file MSMoveReminder.h.


Constructor & Destructor Documentation

Destructor.

Definition at line 67 of file MSDevice_Person.cpp.

MSDevice_Person::MSDevice_Person ( SUMOVehicle holder,
const std::string &  id 
) [private]

Constructor.

Parameters:
[in]holderThe vehicle that holds this device
[in]idThe ID of the device

Definition at line 62 of file MSDevice_Person.cpp.

Referenced by buildVehicleDevices().

Invalidated copy constructor.


Member Function Documentation

Add a passenger.

Parameters:
[in]personThe passenger to add.

Definition at line 126 of file MSDevice_Person.cpp.

References myPersons.

Referenced by MSVehicle::addPerson().

MSDevice_Person * MSDevice_Person::buildVehicleDevices ( SUMOVehicle v,
std::vector< MSDevice * > &  into 
) [static]

Build devices for the given vehicle, if needed.

The built device is stored in the given vector.

Parameters:
[in]vThe vehicle for which a device may be built
in,filled]into The vector to store the built device in

Definition at line 52 of file MSDevice_Person.cpp.

References SUMOVehicle::getID(), and MSDevice_Person().

Referenced by MSVehicle::addPerson().

virtual void MSDevice::generateOutput ( ) const [inline, virtual, inherited]

Called on writing tripinfo output.

The device may write some statistics into the tripinfo output. It is assumed that the written information is a valid xml-snipplet, which will be embedded within the vehicle's information.

The device should use the openTag / closeTag methods of the OutputDevice for correct indentation.

Parameters:
[in]osThe stream to write the information into
Exceptions:
IOErrornot yet implemented

Reimplemented in MSDevice_Tripinfo, MSDevice_HBEFA, and MSDevice_Vehroutes.

Definition at line 102 of file MSDevice.h.

SUMOVehicle& MSDevice::getHolder ( ) const [inline, inherited]

Returns the vehicle that holds this device.

Returns:
The vehicle that holds this device

Definition at line 85 of file MSDevice.h.

References MSDevice::myHolder.

const std::string& Named::getID ( ) const [inline, inherited]

Returns the id.

Returns:
The stored id

Reimplemented in MS_E2_ZS_CollectorOverLanes.

Definition at line 61 of file Named.h.

References Named::myID.

Referenced by MSDetectorControl::add(), ShapeContainer::add(), RORouteDef_Alternatives::addAlternative(), MSNet::addBusStop(), NBLoadedSUMOTLDef::addConnection(), NLHandler::addConnection(), NIImporter_OpenDrive::addE2EConnectionsSecure(), RONet::addNode(), NIImporter_SUMO::addPhase(), RONet::addRouteDef(), NBDistrict::addSink(), NBDistrict::addSource(), MSRouteHandler::addStop(), NIXMLTrafficLightsHandler::addTlConnection(), NIVissimDisturbance::addToNode(), MSVehicle::addTraciStop(), NIVisumTL::build(), MS_E2_ZS_CollectorOverLanes::buildCollector(), NIImporter_VISUM::buildDistrictNode(), NIVissimConnection::buildEdgeConnections(), NBEdge::buildInnerEdges(), NIVissimEdge::buildNBEdge(), NBNodeCont::buildOffRamp(), NBNodeCont::buildOnRamp(), ODDistrictHandler::closeDistrict(), NBTrafficLightDefinition::collectEdges(), NBOwnTLDef::collectLinks(), NBTrafficLightDefinition::compute(), NBNode::computeInternalLaneShape(), NBEdge::computeLaneShapes(), NBNode::computeLogic(), NBNode::computeNodeShape(), NBTrafficLightLogicCont::computeSingleLogic(), NBTurningDirectionsComputer::computeTurnDirectionsForNode(), NBEdge::connections_sorter(), MSLane::detectCollisions(), NIVissimDistrictConnection::dict_BuildDistricts(), MSE3Collector::enter(), Command_SaveTLSSwitches::execute(), MSVTypeProbe::execute(), NBNodeCont::extract(), NBTrafficLightLogicCont::extract(), NBEdgeCont::extract(), MSNet::getBusStopID(), NIImporter_VISUM::getNamedEdgeContinuating(), NLTriggerBuilder::getPosition(), NBNode::getPossiblySplittedIncoming(), NBNode::getPossiblySplittedOutgoing(), NIImporter_VISUM::getReversedContinuating(), NBEdgeCont::ignoreFilterMatch(), MSActuatedTrafficLightLogic::init(), MSAgentbasedTrafficLightLogic::init(), NIImporter_SUMO::initTrafficLightLogic(), NIXMLTrafficLightsHandler::initTrafficLightLogic(), NBDistrictCont::insert(), NBTrafficLightLogicCont::insert(), NBNodeCont::insert(), NBEdgeCont::insert(), NBEdgeCont::joinSameNodeConnectingEdges(), MSE3Collector::leave(), NIImporter_OpenDrive::loadNetwork(), MSLane::moveCritical(), MSVehicle::MSVehicle(), RORDLoader_SUMOBase::myCharacters(), NBOwnTLDef::myCompute(), NBLoadedTLDef::myCompute(), NIXMLTrafficLightsHandler::myEndElement(), NIXMLEdgesHandler::myEndElement(), NIImporter_SUMO::myEndElement(), NIXMLConnectionsHandler::myStartElement(), MSLaneSpeedTrigger::myStartElement(), MSTriggeredRerouter::myStartElement(), NBConnection::NBConnection(), NBRequest::NBRequest(), MSDevice_Tripinfo::notifyEnter(), MSDevice_Tripinfo::notifyLeave(), Named::ComparatorIdLess::operator()(), NBTurningDirectionsComputer::combination_by_angle_sorter::operator()(), NBOwnTLDef::edge_by_incoming_priority_sorter::operator()(), NBNetBuilder::by_id_sorter::operator()(), NBContHelper::same_connection_edge_sorter::operator()(), NBNode::nodes_by_id_sorter::operator()(), NIImporter_VISUM::parse_EdgePolys(), NIImporter_VISUM::parse_Lanes(), NIImporter_VISUM::parse_LanesConnections(), NIImporter_VISUM::parse_Turns(), NIImporter_VISUM::parse_TurnsToSignalGroups(), NIXMLConnectionsHandler::parseDeprecatedLaneDefinition(), NIXMLConnectionsHandler::parseLaneBound(), NBLoadedTLDef::SignalGroup::patchTYellow(), RORouteDef_Complete::preComputeCurrentRoute(), TraCIServerAPI_Lane::processGet(), TraCIServerAPI_TLS::processGet(), TraCIServerAPI_InductionLoop::processGet(), TraCIServerAPI_Vehicle::processGet(), NWWriter_SUMO::prohibitionConnection(), NBLoadedTLDef::SignalGroup::remapIncoming(), NBLoadedTLDef::SignalGroup::remapOutgoing(), NBLoadedSUMOTLDef::removeConnection(), NBNode::removeSelfLoops(), NBEdgeCont::removeUnwishedEdges(), NBNodeCont::removeUnwishedNodes(), NBNodeCont::rename(), NBEdgeCont::rename(), NBConnection::replaceFrom(), MSBaseVehicle::replaceRouteEdges(), NBConnection::replaceTo(), NIXMLTrafficLightsHandler::retrieveLaneIndex(), NBNodeCont::setAsTLControlled(), NBEdge::setControllingTLInformation(), MSLane::setCritical(), NIXMLEdgesHandler::setNodes(), NBOwnTLDef::setTLControllingInformation(), NBLoadedSUMOTLDef::setTLControllingInformation(), NBLoadedTLDef::setTLControllingInformation(), NBEdgeCont::splitAt(), RORDLoader_SUMOBase::startRoute(), NBEdge::startShapeAt(), NIXMLConnectionsHandler::validateLaneInfo(), MSInstantInductLoop::write(), NWWriter_SUMO::writeConnection(), NWWriter_SUMO::writeDistrict(), NWWriter_SUMO::writeEdge(), MSMeanData::writeEdge(), NWWriter_XML::writeEdgesAndConnections(), NWWriter_SUMO::writeInternalConnections(), NWWriter_SUMO::writeJunction(), NWWriter_OpenDrive::writeNetwork(), NWWriter_XML::writeNodes(), MSInductLoop::writeTypedXMLOutput(), MSRouteProbe::writeXMLOutput(), and MSE2Collector::writeXMLOutput().

Adds passengers on vehicle insertion.

Parameters:
[in]vehThe entering vehicle.
[in]reasonhow the vehicle enters the lane
Returns:
Always true
See also:
MSMoveReminder::notifyEnter
MSMoveReminder::Notification

Reimplemented from MSMoveReminder.

Definition at line 98 of file MSDevice_Person.cpp.

References MSNet::getInstance(), myPersons, and MSMoveReminder::NOTIFICATION_DEPARTED.

Passengers leaving on arrival.

Parameters:
[in]vehThe leaving vehicle.
[in]lastPosPosition on the lane when leaving.
[in]isArrivalwhether the vehicle arrived at its destination
[in]isLaneChangewhether the vehicle changed from the lane
Returns:
True if it did not leave the net.

Reimplemented from MSMoveReminder.

Definition at line 109 of file MSDevice_Person.cpp.

References SUMOVehicle::getEdge(), MSEdge::getID(), MSNet::getInstance(), myPersons, MSMoveReminder::NOTIFICATION_ARRIVED, and WRITE_WARNING.

bool MSDevice_Person::notifyMove ( SUMOVehicle veh,
SUMOReal  oldPos,
SUMOReal  newPos,
SUMOReal  newSpeed 
) [virtual]

Checks whether the vehicle is at a stop and person action is needed.

Parameters:
[in]vehThe regarded vehicle
[in]oldPosPosition before the move-micro-timestep.
[in]newPosPosition after the move-micro-timestep.
[in]newSpeedThe vehicle's current speed
Returns:
false, if the vehicle is beyond the lane, true otherwise
See also:
MSMoveReminder
MSMoveReminder::notifyMove
HelpersHBEFA

Reimplemented from MSMoveReminder.

Definition at line 72 of file MSDevice_Person.cpp.

References SUMOVehicle::getEdge(), MSNet::getInstance(), SUMOVehicle::isStopped(), myPersons, and myStopped.

virtual void MSMoveReminder::notifyMoveInternal ( SUMOVehicle veh,
SUMOReal  timeOnLane,
SUMOReal  speed 
) [inline, virtual, inherited]

Internal notification about the vehicle moves.

Indicator if the reminders is still active for the passed vehicle/parameters. If false, the vehicle will erase this reminder from it's reminder-container.

Parameters:
[in]vehVehicle that asks this reminder.
[in]timeOnLanetime the vehicle spent on the lane.
[in]speedMoving speed.

Reimplemented in MSMeanData::MeanDataValueTracker, MSMeanData_Net::MSLaneMeanDataValues, MSMeanData_Harmonoise::MSLaneMeanDataValues, and MSMeanData_HBEFA::MSLaneMeanDataValues.

Definition at line 200 of file MSMoveReminder.h.

References UNUSED_PARAMETER.

MSDevice_Person& MSDevice_Person::operator= ( const MSDevice_Person ) [private]

Invalidated assignment operator.

void Named::setID ( const std::string &  newID) [inline, inherited]

resets the id

Definition at line 67 of file Named.h.

References Named::myID.

Referenced by NBNodeCont::rename(), and NBEdgeCont::rename().


Field Documentation

MSLane* const MSMoveReminder::myLane [protected, inherited]
std::vector<MSPerson*> MSDevice_Person::myPersons [private]

The passengers of the vehicle.

Definition at line 132 of file MSDevice_Person.h.

Referenced by addPerson(), notifyEnter(), notifyLeave(), and notifyMove().

whether the vehicle is at a stop

Definition at line 135 of file MSDevice_Person.h.

Referenced by notifyMove().


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines