Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
ROVehicle Class Reference

A vehicle as used by router. More...

#include <ROVehicle.h>

Inheritance diagram for ROVehicle:
[legend]
Collaboration diagram for ROVehicle:
[legend]

Public Member Functions

void collectJumps (const ConstROEdgeVector &mandatory, std::set< ConstROEdgeVector::const_iterator > &jumpStarts) const
 collect mandatory-edge iterators that define jumps in the route
void computeRoute (const RORouterProvider &provider, const bool removeLoops, MsgHandler *errorHandler)
double getChosenSpeedFactor () const
 Returns an upper bound for the speed factor of this vehicle.
SUMOTime getDepart () const
 Returns the time the vehicle starts at, -1 for triggered vehicles.
const ROEdgegetDepartEdge () const
 Returns the first edge the vehicle takes.
SUMOTime getDepartureTime () const
 Returns the time the vehicle starts at, 0 for triggered vehicles.
const std::string & getID () const
 Returns the id of the routable.
SUMOTime getJumpTime () const
double getLength () const
 Returns the vehicle's length.
ConstROEdgeVector getMandatoryEdges (const ROEdge *requiredStart, const ROEdge *requiredEnd) const
 compute mandatory edges
double getMaxSpeed () const
 Returns the vehicle's maximum speed.
const SUMOVehicleParametergetParameter () const
 Returns the definition of the vehicle / person parameter.
RORouteDefgetRouteDefinition () const
 Returns the definition of the route the vehicle takes.
bool getRoutingSuccess () const
const ConstROEdgeVectorgetStopEdges () const
const SUMOVTypeParametergetType () const
 Returns the type of the routable.
SUMOVehicleClass getVClass () const
const SUMOVTypeParametergetVTypeParameter () const
 Returns the vehicle's type definition.
bool hasJumps () const
bool ignoreTransientPermissions () const
 Returns whether this object is ignoring transient permission changes (during routing).
bool isPartOfFlow () const
bool isPublicTransport () const
 ROVehicle (const SUMOVehicleParameter &pars, RORouteDef *route, const SUMOVTypeParameter *type, const RONet *net, MsgHandler *errorHandler=0)
 Constructor.
void saveAsXML (OutputDevice &os, OutputDevice *const typeos, bool asAlternatives, OptionsCont &options, int cloneIndex=0) const
 Saves the complete vehicle description.
void setDepart (SUMOTime t)
 update depart time (for triggered persons)
void write (OutputDevice *os, OutputDevice *const altos, OutputDevice *const typeos, OptionsCont &options, int quota) const
 Saves the routable including the vehicle type (if it was not saved before).
virtual ~ROVehicle ()
 Destructor.

Protected Attributes

bool myRoutingSuccess
 Whether the last routing was successful.

Private Member Functions

void addStop (const SUMOVehicleParameter::Stop &stopPar, const RONet *net, MsgHandler *errorHandler)
 Adds a stop to this vehicle.
ROVehicleoperator= (const ROVehicle &src)
 Invalidated assignment operator.
 ROVehicle (const ROVehicle &src)
 Invalidated copy constructor.

Private Attributes

SUMOTime myJumpTime
 Whether this vehicle has any jumps defined.
SUMOVehicleParameter myParameter
 The vehicle's parameter.
RORouteDef *const myRoute
 The route the vehicle takes.
ConstROEdgeVector myStopEdges
 The edges where the vehicle stops.
const SUMOVTypeParameter *const myType
 The type of the vehicle.

Static Private Attributes

static std::map< ConstROEdgeVector, std::string > mySavedRoutes
 map of all routes that were already saved with a name

Detailed Description

A vehicle as used by router.

Definition at line 50 of file ROVehicle.h.

Constructor & Destructor Documentation

◆ ROVehicle() [1/2]

ROVehicle::ROVehicle ( const SUMOVehicleParameter & pars,
RORouteDef * route,
const SUMOVTypeParameter * type,
const RONet * net,
MsgHandler * errorHandler = 0 )

Constructor.

Parameters
[in]parsParameter of this vehicle
[in]routeThe definition of the route the vehicle shall use
[in]typeThe type of the vehicle

Definition at line 49 of file ROVehicle.cpp.

References addStop(), RONet::getEdge(), RORouteDef::getFirstRoute(), RORoutable::getParameter(), RORoute::getStops(), myJumpTime, myRoute, myStopEdges, RORoutable::RORoutable(), SUMOVehicleParameter::stops, and SUMOVehicleParameter::via.

Referenced by operator=(), and ROVehicle().

Here is the caller graph for this function:

◆ ~ROVehicle()

ROVehicle::~ROVehicle ( )
virtual

Destructor.

Definition at line 132 of file ROVehicle.cpp.

◆ ROVehicle() [2/2]

ROVehicle::ROVehicle ( const ROVehicle & src)
private

Invalidated copy constructor.

References ROVehicle().

Member Function Documentation

◆ addStop()

void ROVehicle::addStop ( const SUMOVehicleParameter::Stop & stopPar,
const RONet * net,
MsgHandler * errorHandler )
private

Adds a stop to this vehicle.

Parameters
[in]stopParthe stop paramters
[in]netpointer to the network, used for edge retrieval

Definition at line 77 of file ROVehicle.cpp.

References SUMOVehicleParameter::Stop::edge, SUMOVehicleParameter::Stop::endPos, RONet::getEdge(), Named::getID(), RORoutable::getID(), RORoutable::getParameter(), SUMOVehicleParameter::Stop::index, MsgHandler::inform(), ROEdge::isInternal(), SUMOVehicleParameter::Stop::jump, myJumpTime, myRoute, myStopEdges, ROEdge::prohibits(), STOP_INDEX_END, STOP_INDEX_FIT, and SUMOVehicleParameter::stops.

Referenced by ROVehicle().

Here is the caller graph for this function:

◆ collectJumps()

void ROVehicle::collectJumps ( const ConstROEdgeVector & mandatory,
std::set< ConstROEdgeVector::const_iterator > & jumpStarts ) const

collect mandatory-edge iterators that define jumps in the route

Definition at line 215 of file ROVehicle.cpp.

References RORoutable::getParameter(), and SUMOVehicleParameter::stops.

Referenced by RORouteDef::repairCurrentRoute().

Here is the caller graph for this function:

◆ computeRoute()

◆ getChosenSpeedFactor()

double ROVehicle::getChosenSpeedFactor ( ) const
inline

Returns an upper bound for the speed factor of this vehicle.

Returns
the maximum speed factor

Definition at line 109 of file ROVehicle.h.

References Distribution_Parameterized::getMax(), RORoutable::getType(), and SUMOVTypeParameter::speedFactor.

Referenced by ROEdge::getMinimumTravelTime().

Here is the caller graph for this function:

◆ getDepart()

SUMOTime RORoutable::getDepart ( ) const
inlineinherited

Returns the time the vehicle starts at, -1 for triggered vehicles.

Returns
The vehicle's depart time

Definition at line 100 of file RORoutable.h.

References myParameter.

Referenced by RONet::addPerson(), RONet::addVehicle(), and ROVehicleByDepartureComperator::operator()().

Here is the caller graph for this function:

◆ getDepartEdge()

const ROEdge * ROVehicle::getDepartEdge ( ) const
virtual

Returns the first edge the vehicle takes.

Returns
The vehicle's departure edge

Implements RORoutable.

Definition at line 136 of file ROVehicle.cpp.

References myRoute.

◆ getDepartureTime()

SUMOTime ROVehicle::getDepartureTime ( ) const
inline

Returns the time the vehicle starts at, 0 for triggered vehicles.

Returns
The vehicle's depart time

Definition at line 92 of file ROVehicle.h.

References RORoutable::getParameter(), and MAX2().

Referenced by RORouteDef::addAlternative(), RONet::addVehicle(), computeRoute(), and RORoute::writeXMLDefinition().

Here is the caller graph for this function:

◆ getID()

const std::string & RORoutable::getID ( ) const
inlineinherited

Returns the id of the routable.

Returns
The id of the routable

Definition at line 91 of file RORoutable.h.

References myParameter.

Referenced by RORouteDef::addAlternative(), RONet::addPerson(), ROVehicle::addStop(), ROPerson::computeIntermodal(), ROVehicle::computeRoute(), RONet::createBulkRouteRequests(), RORoute::isPermitted(), RORoute::isValid(), ROVehicleByDepartureComperator::operator()(), RORouteDef::preComputeCurrentRoute(), and RORouteDef::repairCurrentRoute().

Here is the caller graph for this function:

◆ getJumpTime()

SUMOTime ROVehicle::getJumpTime ( ) const
inline

Definition at line 129 of file ROVehicle.h.

References myJumpTime.

Referenced by RORouteDef::addAlternative().

Here is the caller graph for this function:

◆ getLength()

double ROVehicle::getLength ( ) const
inline

Returns the vehicle's length.

Definition at line 121 of file ROVehicle.h.

References RORoutable::getType(), and SUMOVTypeParameter::length.

◆ getMandatoryEdges()

ConstROEdgeVector ROVehicle::getMandatoryEdges ( const ROEdge * requiredStart,
const ROEdge * requiredEnd ) const

compute mandatory edges

Definition at line 185 of file ROVehicle.cpp.

References ROEdge::getNormalAfter(), ROEdge::getNormalBefore(), and getStopEdges().

Referenced by computeRoute(), and RORouteDef::repairCurrentRoute().

Here is the caller graph for this function:

◆ getMaxSpeed()

double RORoutable::getMaxSpeed ( ) const
inlineinherited

Returns the vehicle's maximum speed.

Definition at line 121 of file RORoutable.h.

References Parameterised::getParameter(), getType(), and MIN2().

Referenced by ROPerson::computeIntermodal(), RONet::createBulkRouteRequests(), ROEdge::getEffort(), ROEdge::getNoiseEffort(), and ROEdge::getTravelTime().

Here is the caller graph for this function:

◆ getParameter()

const SUMOVehicleParameter & RORoutable::getParameter ( ) const
inlineinherited

Returns the definition of the vehicle / person parameter.

Returns
The vehicle / person's parameter

Definition at line 71 of file RORoutable.h.

References myParameter.

Referenced by RONet::adaptIntermodalRouter(), ROVehicle::addStop(), RONet::addVehicle(), ROVehicle::collectJumps(), ROPerson::computeRoute(), ROVehicle::computeRoute(), ROVehicle::getDepartureTime(), ROVehicle::ROVehicle(), ROPerson::saveAsXML(), and ROVehicle::saveAsXML().

Here is the caller graph for this function:

◆ getRouteDefinition()

RORouteDef * ROVehicle::getRouteDefinition ( ) const
inline

Returns the definition of the route the vehicle takes.

Returns
The vehicle's route definition
Todo
Why not return a reference?

Definition at line 73 of file ROVehicle.h.

References myRoute.

Referenced by ROPerson::computeIntermodal(), computeRoute(), RONet::saveAndRemoveRoutesUntil(), and RONet::~RONet().

Here is the caller graph for this function:

◆ getRoutingSuccess()

bool RORoutable::getRoutingSuccess ( ) const
inlineinherited

Definition at line 165 of file RORoutable.h.

References myRoutingSuccess.

Referenced by RONet::saveAndRemoveRoutesUntil().

Here is the caller graph for this function:

◆ getStopEdges()

const ConstROEdgeVector & ROVehicle::getStopEdges ( ) const
inline

Definition at line 97 of file ROVehicle.h.

References myStopEdges.

Referenced by getMandatoryEdges().

Here is the caller graph for this function:

◆ getType()

const SUMOVTypeParameter * RORoutable::getType ( ) const
inlineinherited

Returns the type of the routable.

Returns
The routable's type
Todo
Why not return a reference?

Definition at line 82 of file RORoutable.h.

References myType.

Referenced by ROPerson::computeIntermodal(), ROVehicle::getChosenSpeedFactor(), ROEdge::getEmissionEffort(), ROVehicle::getLength(), getMaxSpeed(), ROEdge::getMinimumTravelTime(), ROEdge::getNoiseEffort(), ROEdge::getTravelTime(), getVClass(), ROVehicle::getVTypeParameter(), ROEdge::restricts(), ROPerson::saveAsXML(), and ROVehicle::saveAsXML().

Here is the caller graph for this function:

◆ getVClass()

SUMOVehicleClass RORoutable::getVClass ( ) const
inlineinherited

◆ getVTypeParameter()

const SUMOVTypeParameter & ROVehicle::getVTypeParameter ( ) const
inline

Returns the vehicle's type definition.

Returns
The vehicle's type definition

Definition at line 116 of file ROVehicle.h.

References RORoutable::getType().

Referenced by ROEdge::getRoutingFactor().

Here is the caller graph for this function:

◆ hasJumps()

bool ROVehicle::hasJumps ( ) const
inline

Definition at line 125 of file ROVehicle.h.

References myJumpTime.

Referenced by RORouteDef::addAlternative(), and RORouteDef::repairCurrentRoute().

Here is the caller graph for this function:

◆ ignoreTransientPermissions()

bool RORoutable::ignoreTransientPermissions ( ) const
inlineinherited

Returns whether this object is ignoring transient permission changes (during routing).

Definition at line 116 of file RORoutable.h.

◆ isPartOfFlow()

bool RORoutable::isPartOfFlow ( ) const
inlineinherited

Definition at line 133 of file RORoutable.h.

References myParameter.

Referenced by RONet::addVehicle(), RONet::saveAndRemoveRoutesUntil(), ROPerson::saveAsXML(), and ROVehicle::saveAsXML().

Here is the caller graph for this function:

◆ isPublicTransport()

bool RORoutable::isPublicTransport ( ) const
inlineinherited

Definition at line 129 of file RORoutable.h.

References myParameter.

Referenced by RONet::addVehicle(), and RONet::saveAndRemoveRoutesUntil().

Here is the caller graph for this function:

◆ operator=()

ROVehicle & ROVehicle::operator= ( const ROVehicle & src)
private

Invalidated assignment operator.

References ROVehicle().

◆ saveAsXML()

void ROVehicle::saveAsXML ( OutputDevice & os,
OutputDevice *const typeos,
bool asAlternatives,
OptionsCont & options,
int cloneIndex = 0 ) const
virtual

Saves the complete vehicle description.

Saves the vehicle itself including the route and stops.

Parameters
[in]osThe routes or alternatives output device to store the vehicle's description into
[in]typeosThe types - output device to store types into
[in]asAlternativesWhether the route shall be saved as route alternatives
[in]optionsto find out about defaults and whether exit times for the edges shall be written
Exceptions
IOErrorIf something fails (not yet implemented)

Implements RORoutable.

Definition at line 240 of file ROVehicle.cpp.

References GeoConvHelper::cartesian2geo(), OutputDevice::closeTag(), OptionsCont::exists(), OptionsCont::getBool(), RONet::getEdge(), GeoConvHelper::getFinal(), ROEdge::getFromJunction(), Named::getID(), RONet::getInstance(), ROEdge::getLanes(), RORoutable::getParameter(), ROEdge::getPredecessors(), OptionsCont::getString(), ROEdge::getSuccessors(), ROEdge::getToJunction(), RORoutable::getType(), RORoutable::getVClass(), gPrecision, gPrecisionGeo, SUMOVehicleParameter::id, RORoutable::isPartOfFlow(), ROEdge::isTazConnector(), myRoute, mySavedRoutes, SUMOVTypeParameter::saved, OutputDevice::setPrecision(), SUMO_ATTR_FROM, SUMO_ATTR_FROM_JUNCTION, SUMO_ATTR_FROMLONLAT, SUMO_ATTR_FROMXY, SUMO_ATTR_ROUTE, SUMO_ATTR_TO, SUMO_ATTR_TO_JUNCTION, SUMO_ATTR_TOLONLAT, SUMO_ATTR_TOXY, SUMO_ATTR_VIA, SUMO_ATTR_VIAJUNCTIONS, SUMO_ATTR_VIALONLAT, SUMO_ATTR_VIAXY, SUMO_TAG_FLOW, SUMO_TAG_TRIP, SUMO_TAG_VEHICLE, toString(), GeoConvHelper::usingGeoProjection(), SUMOVehicleParameter::write(), SUMOVTypeParameter::write(), OutputDevice::writeAttr(), and Parameterised::writeParams().

◆ setDepart()

void RORoutable::setDepart ( SUMOTime t)
inlineinherited

update depart time (for triggered persons)

Definition at line 105 of file RORoutable.h.

References myParameter.

◆ write()

void RORoutable::write ( OutputDevice * os,
OutputDevice *const altos,
OutputDevice *const typeos,
OptionsCont & options,
int quota ) const
inlineinherited

Saves the routable including the vehicle type (if it was not saved before).

Parameters
[in]osThe routes - output device to store the vehicle's description into
[in]altosThe route alternatives - output device to store the vehicle's description into
[in]typeosThe types - output device to store the vehicle types into
Exceptions
IOErrorIf something fails (not yet implemented)

Definition at line 148 of file RORoutable.h.

References saveAsXML().

Referenced by RONet::saveAndRemoveRoutesUntil().

Here is the caller graph for this function:

Field Documentation

◆ myJumpTime

SUMOTime ROVehicle::myJumpTime
private

Whether this vehicle has any jumps defined.

Definition at line 166 of file ROVehicle.h.

Referenced by addStop(), getJumpTime(), hasJumps(), and ROVehicle().

◆ myParameter

SUMOVehicleParameter RORoutable::myParameter
privateinherited

The vehicle's parameter.

Definition at line 186 of file RORoutable.h.

Referenced by getDepart(), getID(), getParameter(), isPartOfFlow(), isPublicTransport(), RORoutable(), and setDepart().

◆ myRoute

RORouteDef* const ROVehicle::myRoute
private

The route the vehicle takes.

Definition at line 160 of file ROVehicle.h.

Referenced by addStop(), getDepartEdge(), getRouteDefinition(), ROVehicle(), and saveAsXML().

◆ myRoutingSuccess

bool RORoutable::myRoutingSuccess
protectedinherited

Whether the last routing was successful.

Definition at line 193 of file RORoutable.h.

Referenced by ROPerson::computeIntermodal(), ROPerson::computeRoute(), ROVehicle::computeRoute(), getRoutingSuccess(), and RORoutable().

◆ mySavedRoutes

std::map< ConstROEdgeVector, std::string > ROVehicle::mySavedRoutes
staticprivate

map of all routes that were already saved with a name

Definition at line 169 of file ROVehicle.h.

Referenced by saveAsXML().

◆ myStopEdges

ConstROEdgeVector ROVehicle::myStopEdges
private

The edges where the vehicle stops.

Definition at line 163 of file ROVehicle.h.

Referenced by addStop(), getStopEdges(), and ROVehicle().

◆ myType

const SUMOVTypeParameter* const RORoutable::myType
privateinherited

The type of the vehicle.

Definition at line 189 of file RORoutable.h.

Referenced by getType(), and RORoutable().


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