![]() |
SUMO - Simulation of Urban MObility
|
#include <MSTransportable.h>


Data Structures | |
| class | Stage |
| class | Stage_Driving |
| class | Stage_Waiting |
Public Types | |
| typedef std::vector< MSTransportable::Stage * > | MSTransportablePlan |
| the structure holding the plan of a transportable More... | |
| enum | StageType { WAITING_FOR_DEPART = 0, WAITING = 1, MOVING_WITHOUT_VEHICLE = 2, DRIVING = 3 } |
Public Member Functions | |
| void | appendStage (Stage *stage, int next=-1) |
| Appends the given stage to the current plan. More... | |
| virtual double | getAngle () const |
| return the current angle of the transportable More... | |
| const MSEdge * | getArrivalEdge () const |
| returns the final arrival edge More... | |
| double | getArrivalPos () const |
| returns the final arrival pos More... | |
| PositionVector | getBoundingBox () const |
| return the bounding box of the person More... | |
| MSTransportable::Stage * | getCurrentStage () const |
| Return the current stage. More... | |
| std::string | getCurrentStageDescription () const |
| Returns the current stage description as a string. More... | |
| StageType | getCurrentStageType () const |
| the current stage type of the transportable More... | |
| SUMOTime | getDesiredDepart () const |
| Returns the desired departure time. More... | |
| const MSEdge & | getDestination () const |
| Returns the current destination. More... | |
| const MSEdge * | getEdge () const |
| Returns the current edge. More... | |
| virtual double | getEdgePos () const |
| Return the position on the edge. More... | |
| ConstMSEdgeVector | getEdges (int next) const |
| Return the edges of the nth next stage. More... | |
| const MSEdge * | getFromEdge () const |
| Returns the departure edge. More... | |
| const std::string & | getID () const |
| returns the id of the transportable More... | |
| const MSEdge & | getNextDestination () const |
| Returns the destination after the current destination. More... | |
| int | getNumRemainingStages () const |
| Return the number of remaining stages (including the current) More... | |
| int | getNumStages () const |
| Return the total number stages in this persons plan. More... | |
| const SUMOVehicleParameter & | getParameter () const |
| virtual Position | getPosition () const |
| Return the Network coordinate of the transportable. More... | |
| MSVehicleType & | getSingularType () |
| Replaces the current vehicle type with a new one used by this vehicle only. More... | |
| virtual double | getSpeed () const |
| the current speed of the transportable More... | |
| virtual double | getSpeedFactor () const |
| the current speed factor of the transportable (where applicable) More... | |
| StageType | getStageType (int next) const |
| the stage type for the nth next stage More... | |
| SUMOVehicle * | getVehicle () const |
| The vehicle associated with this transportable. More... | |
| const MSVehicleType & | getVehicleType () const |
| virtual double | getWaitingSeconds () const |
| the time this transportable spent waiting in seconds More... | |
| bool | isWaiting4Vehicle () const |
| Whether the transportable waits for a vehicle. More... | |
| bool | isWaitingFor (const std::string &line) const |
| Whether the transportable waits for a vehicle of the line specified. More... | |
| MSTransportable (const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportablePlan *plan) | |
| constructor More... | |
| virtual bool | proceed (MSNet *net, SUMOTime time)=0 |
| void | removeStage (int next) |
| removes the nth next stage More... | |
| void | replaceVehicleType (MSVehicleType *type) |
| Replaces the current vehicle type by the one given. More... | |
| virtual void | routeOutput (OutputDevice &os) const =0 |
| Called on writing vehroute output. More... | |
| void | setDeparted (SUMOTime now) |
| logs depart time of the current stage More... | |
| void | setSpeed (double speed) |
| sets the walking speed (ignored in other stages) More... | |
| virtual void | tripInfoOutput (OutputDevice &os) const =0 |
| Called on writing tripinfo output. More... | |
| virtual | ~MSTransportable () |
| destructor More... | |
Protected Attributes | |
| const SUMOVehicleParameter * | myParameter |
| the plan of the transportable More... | |
| MSTransportablePlan * | myPlan |
| the plan of the transportable More... | |
| MSTransportablePlan::iterator | myStep |
| the iterator over the route More... | |
| MSVehicleType * | myVType |
| This transportable's type. (mainly used for drawing related information Note sure if it is really necessary. More... | |
| bool | myWriteEvents |
| Whether events shall be written. More... | |
Static Protected Attributes | |
| static const double | ROADSIDE_OFFSET |
| the offset for computing positions when standing at an edge More... | |
Private Member Functions | |
| MSTransportable (const MSTransportable &) | |
| Invalidated copy constructor. More... | |
| MSTransportable & | operator= (const MSTransportable &) |
| Invalidated assignment operator. More... | |
The class holds a simulated moveable object
Definition at line 62 of file MSTransportable.h.
| typedef std::vector<MSTransportable::Stage*> MSTransportable::MSTransportablePlan |
the structure holding the plan of a transportable
Definition at line 378 of file MSTransportable.h.
| Enumerator | |
|---|---|
| WAITING_FOR_DEPART | |
| WAITING | |
| MOVING_WITHOUT_VEHICLE | |
| DRIVING | |
Definition at line 64 of file MSTransportable.h.
| MSTransportable::MSTransportable | ( | const SUMOVehicleParameter * | pars, |
| MSVehicleType * | vtype, | ||
| MSTransportablePlan * | plan | ||
| ) |
|
virtual |
destructor
Definition at line 375 of file MSTransportable.cpp.
References MSNet::getInstance(), MSNet::getVehicleControl(), MSVehicleType::isVehicleSpecific(), myParameter, myPlan, myVType, and MSVehicleControl::removeVType().
|
private |
Invalidated copy constructor.
| void MSTransportable::appendStage | ( | Stage * | stage, |
| int | next = -1 |
||
| ) |
Appends the given stage to the current plan.
Definition at line 441 of file MSTransportable.cpp.
References getID(), myPlan, myStep, and toString().
Referenced by getVehicle(), TraCIServerAPI_Person::processSet(), and removeStage().
|
virtual |
return the current angle of the transportable
Reimplemented in GUIContainer.
Definition at line 415 of file MSTransportable.cpp.
References MSNet::getCurrentTimeStep(), and MSNet::getInstance().
Referenced by GUIPerson::drawAction_drawAsImage(), GUIPerson::drawAction_drawAsPoly(), GUIPerson::drawAction_drawAsTriangle(), GUIContainer::getAngle(), getBoundingBox(), GUIPerson::getNaviDegree(), TraCIServerAPI_Person::processGet(), GUIPerson::setFunctionalColor(), MSFCDExport::writeTransportable(), and MSXMLRawOut::writeTransportable().
|
inline |
returns the final arrival edge
Definition at line 526 of file MSTransportable.h.
References getBoundingBox(), getSingularType(), myPlan, and replaceVehicleType().
Referenced by TraCIServerAPI_Person::processSet().
|
inline |
returns the final arrival pos
Definition at line 521 of file MSTransportable.h.
References myPlan.
Referenced by TraCIServerAPI_Person::processSet().
| PositionVector MSTransportable::getBoundingBox | ( | ) | const |
return the bounding box of the person
Definition at line 506 of file MSTransportable.cpp.
References PositionVector::append(), getAngle(), MSVehicleType::getLength(), getPosition(), getVehicleType(), PositionVector::move2side(), POSITION_EPS, and PositionVector::reverse().
Referenced by getArrivalEdge().
|
inline |
Return the current stage.
Definition at line 465 of file MSTransportable.h.
References myStep.
Referenced by GUIPerson::drawAction_drawWalkingareaPath(), GUIPerson::drawGLAdditional(), and MSEdge::transportable_by_position_sorter::operator()().
|
inline |
Returns the current stage description as a string.
Definition at line 460 of file MSTransportable.h.
Referenced by GUIContainer::getParameterWindow(), GUIPerson::getParameterWindow(), and MSXMLRawOut::writeTransportable().
|
inline |
the current stage type of the transportable
Definition at line 448 of file MSTransportable.h.
Referenced by MSPModel_Remote::add(), MSPModel_Striping::add(), GUIContainer::drawGL(), GUIPerson::drawGL(), GUIPerson::drawGLAdditional(), GUIContainer::getColorValue(), GUIPerson::getColorValue(), MSPerson::getNextEdgePtr(), GUIContainer::getPosition(), MSPerson::getSpeedFactor(), and TraCIServerAPI_Person::processSet().
| SUMOTime MSTransportable::getDesiredDepart | ( | ) | const |
Returns the desired departure time.
Definition at line 395 of file MSTransportable.cpp.
References SUMOVehicleParameter::depart, and myParameter.
Referenced by getVehicleType(), MSContainer::routeOutput(), MSPerson::routeOutput(), MSContainer::tripInfoOutput(), and MSPerson::tripInfoOutput().
|
inline |
Returns the current destination.
Definition at line 408 of file MSTransportable.h.
Referenced by GUIContainer::getParameterWindow(), GUIPerson::getParameterWindow(), MSDevice_Transportable::notifyLeave(), and MSDevice_Transportable::notifyMove().
|
inline |
Returns the current edge.
Definition at line 418 of file MSTransportable.h.
Referenced by MSPModel_Striping::add(), GUIContainer::getParameterWindow(), GUIPerson::getParameterWindow(), GUIContainer::getPosition(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Person::processSet(), and removeStage().
|
virtual |
Return the position on the edge.
Reimplemented in GUIPerson, and GUIContainer.
Definition at line 405 of file MSTransportable.cpp.
References MSNet::getCurrentTimeStep(), and MSNet::getInstance().
Referenced by GUIContainer::getEdgePos(), GUIPerson::getEdgePos(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Person::processSet(), removeStage(), MSFCDExport::writeTransportable(), and MSXMLRawOut::writeTransportable().
|
inline |
Return the edges of the nth next stage.
Definition at line 470 of file MSTransportable.h.
References MSTransportable::Stage::getEdges(), getNumRemainingStages(), getNumStages(), myPlan, myStep, MSTransportable::Stage::routeOutput(), and MSTransportable::Stage::tripInfoOutput().
Referenced by TraCIServerAPI_Person::processGet(), and TraCIServerAPI_Person::processSet().
|
inline |
Returns the departure edge.
Definition at line 423 of file MSTransportable.h.
References MSTransportable::Stage::getAngle(), MSTransportable::Stage::getEdgePos(), MSTransportable::Stage::getPosition(), MSTransportable::Stage::getSpeed(), and getWaitingSeconds().
Referenced by GUIContainer::getParameterWindow(), and GUIPerson::getParameterWindow().
| const std::string & MSTransportable::getID | ( | ) | const |
returns the id of the transportable
Definition at line 390 of file MSTransportable.cpp.
References SUMOVehicleParameter::id, and myParameter.
Referenced by MSTransportableControl::abortWaitingForVehicle(), MSPModel_Remote::add(), MSPModel_Striping::add(), MSBaseVehicle::addContainer(), MSVehicle::addContainer(), MSBaseVehicle::addPerson(), MSVehicle::addPerson(), appendStage(), MSPerson::MSPersonStage_Walking::beginEventOutput(), MSContainer::MSContainerStage_Tranship::beginEventOutput(), MSTransportable::Stage_Waiting::beginEventOutput(), MSTransportable::Stage_Driving::beginEventOutput(), MSPerson::MSPersonStage_Walking::endEventOutput(), MSContainer::MSContainerStage_Tranship::endEventOutput(), MSTransportable::Stage_Waiting::endEventOutput(), MSTransportable::Stage_Driving::endEventOutput(), MSTransportableControl::erase(), MSPModel_Striping::MovePedestrians::execute(), MSPModel_Striping::getNeighboringObstacles(), MSPModel_Striping::getNextLane(), MSPModel_Striping::getNextLaneObstacles(), GUIContainer::getParameterWindow(), GUIPerson::getParameterWindow(), getSingularType(), MSPedestrianPushButton::isActiveForEdge(), MSPModel_Striping::moveInDirection(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::PState::moveToNextLane(), MSDevice_Transportable::notifyLeave(), MSPModel_Striping::by_xpos_sorter::operator()(), MSEdge::transportable_by_position_sorter::operator()(), MSContainer::MSContainerStage_Driving::proceed(), MSPerson::MSPersonStage_Driving::proceed(), MSPModel_Striping::PState::PState(), MSContainer::MSContainerStage_Driving::routeOutput(), MSContainer::routeOutput(), MSTransportable::Stage_Waiting::routeOutput(), MSPerson::MSPersonStage_Driving::routeOutput(), MSPerson::routeOutput(), MSContainer::tripInfoOutput(), MSPerson::tripInfoOutput(), MSPModel_Striping::PState::walk(), MSFCDExport::writeTransportable(), and MSXMLRawOut::writeTransportable().
|
inline |
Returns the destination after the current destination.
Definition at line 413 of file MSTransportable.h.
References myStep.
| int MSTransportable::getNumRemainingStages | ( | ) | const |
Return the number of remaining stages (including the current)
Definition at line 431 of file MSTransportable.cpp.
References myPlan, and myStep.
Referenced by getEdges(), TraCIServerAPI_Person::processGet(), and TraCIServerAPI_Person::processSet().
| int MSTransportable::getNumStages | ( | ) | const |
Return the total number stages in this persons plan.
Definition at line 436 of file MSTransportable.cpp.
References myPlan.
Referenced by getEdges(), and TraCIServerAPI_Person::processGet().
|
inline |
Definition at line 393 of file MSTransportable.h.
References myParameter.
Referenced by MSTransportableControl::add(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Person::processSet(), GUIContainer::setFunctionalColor(), and GUIPerson::setFunctionalColor().
|
virtual |
Return the Network coordinate of the transportable.
Reimplemented in GUIPerson, and GUIContainer.
Definition at line 410 of file MSTransportable.cpp.
References MSNet::getCurrentTimeStep(), and MSNet::getInstance().
Referenced by getBoundingBox(), MSLink::getLeaderInfo(), TraCIServerAPI_Person::getPosition(), GUIContainer::getPosition(), GUIPerson::getPosition(), TraCIServerAPI_Person::processGet(), and MSFCDExport::writeTransportable().
| MSVehicleType & MSTransportable::getSingularType | ( | ) |
Replaces the current vehicle type with a new one used by this vehicle only.
If the currently used vehicle type is already marked as being used by this vehicle only, no new type is created.
Definition at line 495 of file MSTransportable.cpp.
References MSVehicleType::buildSingularType(), MSVehicleType::getID(), getID(), MSVehicleType::isVehicleSpecific(), myVType, and replaceVehicleType().
Referenced by getArrivalEdge(), and TraCIServerAPI_Person::processSet().
|
virtual |
the current speed of the transportable
Reimplemented in GUIPerson, and GUIContainer.
Definition at line 425 of file MSTransportable.cpp.
Referenced by GUIContainer::getSpeed(), GUIPerson::getSpeed(), TraCIServerAPI_Person::processGet(), and MSFCDExport::writeTransportable().
|
inlinevirtual |
the current speed factor of the transportable (where applicable)
Reimplemented in MSPerson.
Definition at line 443 of file MSTransportable.h.
|
inline |
the stage type for the nth next stage
Definition at line 453 of file MSTransportable.h.
References MSTransportable::Stage::getStageType(), myPlan, and myStep.
Referenced by TraCIServerAPI_Person::processGet().
|
inline |
The vehicle associated with this transportable.
Definition at line 507 of file MSTransportable.h.
References appendStage(), removeStage(), and MSTransportable::Stage::setSpeed().
Referenced by TraCIServerAPI_Person::processGet().
|
inline |
Definition at line 397 of file MSTransportable.h.
References getDesiredDepart(), myVType, and MSTransportable::Stage::setDeparted().
Referenced by MSStoppingPlace::addTransportable(), GUIContainer::drawAction_drawAsImage(), GUIPerson::drawAction_drawAsImage(), GUIContainer::drawAction_drawAsPoly(), GUIPerson::drawAction_drawAsPoly(), GUIPerson::drawAction_drawAsTriangle(), getBoundingBox(), GUIPerson::getCenteringBoundary(), MSPModel_Striping::PState::getImpatience(), MSLink::getLeaderInfo(), MSPModel_Striping::PState::getLength(), MSPModel_Striping::PState::getMinGap(), MSPModel_Striping::getNextLaneObstacles(), MSPModel_Striping::PState::ignoreRed(), MSPModel_Striping::moveInDirectionOnLane(), MSPModel_Striping::nextBlocking(), MSPModel_Striping::PState::otherStripe(), TraCIServerAPI_Person::processGet(), TraCIServerAPI_Person::processSet(), MSStoppingPlace::removeTransportable(), GUIContainer::setFunctionalColor(), and GUIPerson::setFunctionalColor().
|
virtual |
the time this transportable spent waiting in seconds
Reimplemented in GUIPerson, and GUIContainer.
Definition at line 420 of file MSTransportable.cpp.
References MSNet::getCurrentTimeStep(), MSNet::getInstance(), and STEPS2TIME.
Referenced by getFromEdge(), GUIContainer::getWaitingSeconds(), GUIPerson::getWaitingSeconds(), MSPedestrianPushButton::isActiveForEdge(), and TraCIServerAPI_Person::processGet().
|
inline |
Whether the transportable waits for a vehicle.
Definition at line 502 of file MSTransportable.h.
Referenced by GUIContainer::drawGL(), GUIPerson::drawGL(), GUIContainer::getColorValue(), and GUIPerson::getColorValue().
|
inline |
Whether the transportable waits for a vehicle of the line specified.
Definition at line 497 of file MSTransportable.h.
|
private |
Invalidated assignment operator.
| void MSTransportable::removeStage | ( | int | next | ) |
removes the nth next stage
Definition at line 457 of file MSTransportable.cpp.
References appendStage(), getEdge(), getEdgePos(), MSNet::getInstance(), myPlan, myStep, and proceed().
Referenced by getVehicle(), and TraCIServerAPI_Person::processSet().
| void MSTransportable::replaceVehicleType | ( | MSVehicleType * | type | ) |
Replaces the current vehicle type by the one given.
If the currently used vehicle type is marked as being used by this vehicle only, it is deleted, first. The new, given type is then assigned to "myVType".
| [in] | type | The new vehicle type |
Definition at line 486 of file MSTransportable.cpp.
References MSNet::getInstance(), MSNet::getVehicleControl(), MSVehicleType::isVehicleSpecific(), myVType, and MSVehicleControl::removeVType().
Referenced by getArrivalEdge(), getSingularType(), and TraCIServerAPI_Person::processSet().
|
pure virtual |
Called on writing vehroute output.
| [in] | os | The stream to write the information into |
| IOError | not yet implemented |
Implemented in MSPerson, and MSContainer.
Referenced by MSTransportableControl::erase().
| void MSTransportable::setDeparted | ( | SUMOTime | now | ) |
logs depart time of the current stage
Definition at line 400 of file MSTransportable.cpp.
| void MSTransportable::setSpeed | ( | double | speed | ) |
sets the walking speed (ignored in other stages)
Definition at line 478 of file MSTransportable.cpp.
References myPlan.
Referenced by TraCIServerAPI_Person::processSet().
|
pure virtual |
Called on writing tripinfo output.
| [in] | os | The stream to write the information into |
| IOError | not yet implemented |
Implemented in MSPerson, and MSContainer.
Referenced by MSTransportableControl::erase().
|
protected |
the plan of the transportable
Definition at line 559 of file MSTransportable.h.
Referenced by getDesiredDepart(), getID(), getParameter(), and ~MSTransportable().
|
protected |
the plan of the transportable
Definition at line 569 of file MSTransportable.h.
Referenced by appendStage(), getArrivalEdge(), getArrivalPos(), getEdges(), getNumRemainingStages(), getNumStages(), getStageType(), MSTransportable(), MSContainer::proceed(), MSPerson::proceed(), removeStage(), MSContainer::routeOutput(), MSPerson::routeOutput(), setSpeed(), MSContainer::tripInfoOutput(), MSPerson::tripInfoOutput(), and ~MSTransportable().
|
protected |
the iterator over the route
Definition at line 572 of file MSTransportable.h.
Referenced by appendStage(), getCurrentStage(), getEdges(), getNextDestination(), getNumRemainingStages(), getStageType(), MSTransportable(), MSContainer::proceed(), MSPerson::proceed(), removeStage(), MSContainer::routeOutput(), and MSPerson::routeOutput().
|
protected |
This transportable's type. (mainly used for drawing related information Note sure if it is really necessary.
Definition at line 563 of file MSTransportable.h.
Referenced by getSingularType(), MSPerson::getSpeedFactor(), GUIPerson::getTypeParameterWindow(), getVehicleType(), replaceVehicleType(), and ~MSTransportable().
|
protected |
Whether events shall be written.
Definition at line 566 of file MSTransportable.h.
|
staticprotected |
the offset for computing positions when standing at an edge
Definition at line 556 of file MSTransportable.h.
Referenced by MSTransportable::Stage_Waiting::getPosition(), and MSTransportable::Stage_Driving::getPosition().