SUMO - Simulation of Urban MObility
ROVehicle Class Reference

A vehicle as used by router. More...

#include <ROVehicle.h>

Inheritance diagram for ROVehicle:
Inheritance graph
Collaboration diagram for ROVehicle:
Collaboration graph

Public Member Functions

void computeRoute (const RORouterProvider &provider, const bool removeLoops, MsgHandler *errorHandler)
 
double getChosenSpeedFactor () const
 Returns an upper bound for the speed factor of this vehicle. More...
 
SUMOTime getDepart () const
 Returns the time the vehicle starts at, -1 for triggered vehicles. More...
 
const ROEdgegetDepartEdge () const
 Returns the first edge the vehicle takes. More...
 
SUMOTime getDepartureTime () const
 Returns the time the vehicle starts at, 0 for triggered vehicles. More...
 
const std::string & getID () const
 Returns the id of the vehicle. More...
 
double getMaxSpeed () const
 Returns the vehicle's maximum speed. More...
 
const SUMOVehicleParametergetParameter () const
 Returns the definition of the vehicle parameter. More...
 
RORouteDefgetRouteDefinition () const
 Returns the definition of the route the vehicle takes. More...
 
bool getRoutingSuccess () const
 
const ConstROEdgeVectorgetStopEdges () const
 
const SUMOVTypeParametergetType () const
 Returns the type of the vehicle. More...
 
SUMOVehicleClass getVClass () const
 
 ROVehicle (const SUMOVehicleParameter &pars, RORouteDef *route, const SUMOVTypeParameter *type, const RONet *net, MsgHandler *errorHandler=0)
 Constructor. More...
 
void saveAsXML (OutputDevice &os, OutputDevice *const typeos, bool asAlternatives, OptionsCont &options) const
 Saves the complete vehicle description. More...
 
void write (OutputDevice &os, OutputDevice *const altos, OutputDevice *const typeos, OptionsCont &options) const
 Saves the routable including the vehicle type (if it was not saved before). More...
 
virtual ~ROVehicle ()
 Destructor. More...
 

Protected Attributes

SUMOVehicleParameter myParameter
 The vehicle's parameter. More...
 
bool myRoutingSuccess
 Whether the last routing was successful. More...
 
const SUMOVTypeParameter *const myType
 The type of the vehicle. More...
 

Private Member Functions

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

Private Attributes

RORouteDef *const myRoute
 The route the vehicle takes. More...
 
ConstROEdgeVector myStopEdges
 The edges where the vehicle stops. More...
 

Detailed Description

A vehicle as used by router.

Definition at line 60 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 52 of file ROVehicle.cpp.

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

◆ ~ROVehicle()

ROVehicle::~ROVehicle ( )
virtual

Destructor.

Definition at line 121 of file ROVehicle.cpp.

◆ ROVehicle() [2/2]

ROVehicle::ROVehicle ( const ROVehicle src)
private

Invalidated copy constructor.

Member Function Documentation

◆ addStop()

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

◆ 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 124 of file ROVehicle.h.

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

Referenced by ROEdge::getMinimumTravelTime().

◆ 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 101 of file RORoutable.h.

References SUMOVehicleParameter::depart, and RORoutable::myParameter.

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

◆ 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 125 of file ROVehicle.cpp.

References RORoute::getFirst(), RORouteDef::getFirstRoute(), and myRoute.

Referenced by getParameter().

◆ 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 111 of file ROVehicle.h.

References SUMOVehicleParameter::depart, MAX2(), and RORoutable::myParameter.

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

◆ getID()

◆ getMaxSpeed()

double RORoutable::getMaxSpeed ( ) const
inlineinherited

Returns the vehicle's maximum speed.

Definition at line 112 of file RORoutable.h.

References RORoutable::computeRoute(), RORoutable::getDepartEdge(), SUMOVTypeParameter::maxSpeed, and RORoutable::myType.

Referenced by RONet::createBulkRouteRequests().

◆ getParameter()

const SUMOVehicleParameter& ROVehicle::getParameter ( ) const
inline

Returns the definition of the vehicle parameter.

Returns
The vehicle's parameter

Definition at line 92 of file ROVehicle.h.

References computeRoute(), getDepartEdge(), and RORoutable::myParameter.

Referenced by RONet::adaptIntermodalRouter().

◆ 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 83 of file ROVehicle.h.

References myRoute.

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

◆ getRoutingSuccess()

bool RORoutable::getRoutingSuccess ( ) const
inlineinherited

Definition at line 144 of file RORoutable.h.

References RORoutable::myRoutingSuccess, and RORoutable::saveAsXML().

Referenced by RONet::saveAndRemoveRoutesUntil().

◆ getStopEdges()

const ConstROEdgeVector& ROVehicle::getStopEdges ( ) const
inline

Definition at line 116 of file ROVehicle.h.

References myStopEdges.

Referenced by RORouteDef::repairCurrentRoute().

◆ getType()

const SUMOVTypeParameter* RORoutable::getType ( ) const
inlineinherited

Returns the type of the vehicle.

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

Definition at line 83 of file RORoutable.h.

References RORoutable::myType.

Referenced by getChosenSpeedFactor(), ROEdge::getEffort(), ROEdge::getEmissionEffort(), ROEdge::getMinimumTravelTime(), ROEdge::getNoiseEffort(), ROEdge::getTravelTime(), and RORoutable::getVClass().

◆ getVClass()

SUMOVehicleClass RORoutable::getVClass ( ) const
inlineinherited

◆ operator=()

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

Invalidated assignment operator.

◆ saveAsXML()

void ROVehicle::saveAsXML ( OutputDevice os,
OutputDevice *const  typeos,
bool  asAlternatives,
OptionsCont options 
) 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 167 of file ROVehicle.cpp.

References OutputDevice::closeTag(), OptionsCont::getBool(), RORoutable::myParameter, myRoute, RORoutable::myType, SUMOVTypeParameter::saved, SUMOVehicleParameter::stops, SUMOVTypeParameter::write(), SUMOVehicleParameter::write(), Parameterised::writeParams(), and RORouteDef::writeXMLDefinition().

Referenced by getChosenSpeedFactor().

◆ write()

void RORoutable::write ( OutputDevice os,
OutputDevice *const  altos,
OutputDevice *const  typeos,
OptionsCont options 
) 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 131 of file RORoutable.h.

References RORoutable::saveAsXML().

Referenced by RONet::saveAndRemoveRoutesUntil().

Field Documentation

◆ myParameter

SUMOVehicleParameter RORoutable::myParameter
protectedinherited

◆ myRoute

RORouteDef* const ROVehicle::myRoute
private

The route the vehicle takes.

Definition at line 153 of file ROVehicle.h.

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

◆ myRoutingSuccess

bool RORoutable::myRoutingSuccess
protectedinherited

Whether the last routing was successful.

Definition at line 171 of file RORoutable.h.

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

◆ myStopEdges

ConstROEdgeVector ROVehicle::myStopEdges
private

The edges where the vehicle stops.

Definition at line 156 of file ROVehicle.h.

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

◆ myType

const SUMOVTypeParameter* const RORoutable::myType
protectedinherited

The type of the vehicle.

Definition at line 168 of file RORoutable.h.

Referenced by ROPerson::computeIntermodal(), RORoutable::getMaxSpeed(), RORoutable::getType(), saveAsXML(), and ROPerson::saveAsXML().


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