SUMO - Simulation of Urban MObility
ROVehicle Class Reference

A vehicle as used by router. More...

#include <ROVehicle.h>

Collaboration diagram for ROVehicle:
Collaboration graph

Public Member Functions

SUMOReal 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...
 
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...
 
SUMOReal getMaxSpeed () const
 Returns the vehicle's maximum speed. 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)
 Constructor. More...
 
void saveAllAsXML (OutputDevice &os, bool asAlternatives, bool withExitTimes) const
 Saves the complete vehicle description. More...
 
void saveTypeAsXML (OutputDevice &os, OutputDevice *const altos, OutputDevice *const typeos) const
 Saves the vehicle type if it was not saved before. More...
 
void setRoutingSuccess (const bool val)
 
virtual ~ROVehicle ()
 Destructor. More...
 

Protected Attributes

SUMOVehicleParameter myParameter
 The vehicle's parameter. More...
 
RORouteDef *const myRoute
 The route the vehicle takes. More...
 
bool myRoutingSuccess
 Whether the last routing was successful. More...
 
ConstROEdgeVector myStopEdges
 The edges where the vehicle stops. More...
 
const SUMOVTypeParameter *const myType
 The type of the vehicle. More...
 

Private Member Functions

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

Detailed Description

A vehicle as used by router.

Definition at line 60 of file ROVehicle.h.

Constructor & Destructor Documentation

ROVehicle::ROVehicle ( const SUMOVehicleParameter pars,
RORouteDef route,
const SUMOVTypeParameter type,
const RONet net 
)

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

References addStop(), RORouteDef::getFirstRoute(), RORoute::getStops(), myParameter, and SUMOVehicleParameter::stops.

ROVehicle::~ROVehicle ( )
virtual

Destructor.

Definition at line 112 of file ROVehicle.cpp.

ROVehicle::ROVehicle ( const ROVehicle src)
private

Invalidated copy constructor.

Member Function Documentation

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

Adds a stop to this vehicle.

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

Definition at line 72 of file ROVehicle.cpp.

References SUMOVehicleParameter::Stop::endPos, RONet::getEdge(), RORoute::getEdgeVector(), RORouteDef::getFirstRoute(), SUMOVehicleParameter::Stop::index, SUMOVehicleParameter::Stop::lane, myParameter, myRoute, myStopEdges, STOP_INDEX_END, STOP_INDEX_FIT, and SUMOVehicleParameter::stops.

Referenced by getRoutingSuccess(), and ROVehicle().

SUMOReal ROVehicle::getChosenSpeedFactor ( ) const
inline

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

Returns
the maximum speed factor

Definition at line 140 of file ROVehicle.h.

References getType(), saveAllAsXML(), saveTypeAsXML(), SUMOVTypeParameter::speedFactor, and SUMOReal.

Referenced by ROEdge::getMinimumTravelTime().

SUMOTime ROVehicle::getDepart ( ) const
inline

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

Returns
The vehicle's depart time

Definition at line 120 of file ROVehicle.h.

References SUMOVehicleParameter::depart, and myParameter.

Referenced by RONet::createBulkRouteRequests(), ROVehicleByDepartureComperator::operator()(), and RONet::saveAndRemoveRoutesUntil().

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

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

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

SUMOReal ROVehicle::getMaxSpeed ( ) const

Returns the vehicle's maximum speed.

Definition at line 153 of file ROVehicle.cpp.

References SUMOVTypeParameter::maxSpeed, and myType.

Referenced by RONet::createBulkRouteRequests(), and getStopEdges().

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 RONet::computeRoute(), RONet::createBulkRouteRequests(), and RONet::saveAndRemoveRoutesUntil().

bool ROVehicle::getRoutingSuccess ( ) const
inline

Definition at line 170 of file ROVehicle.h.

References addStop(), and myRoutingSuccess.

Referenced by RONet::saveAndRemoveRoutesUntil().

const ConstROEdgeVector& ROVehicle::getStopEdges ( ) const
inline

Definition at line 124 of file ROVehicle.h.

References getMaxSpeed(), myStopEdges, and SUMOReal.

Referenced by RORouteDef::repairCurrentRoute().

const SUMOVTypeParameter* ROVehicle::getType ( ) const
inline

Returns the type of the vehicle.

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

Definition at line 94 of file ROVehicle.h.

References myType.

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

SUMOVehicleClass ROVehicle::getVClass ( ) const
inline
ROVehicle& ROVehicle::operator= ( const ROVehicle src)
private

Invalidated assignment operator.

void ROVehicle::saveAllAsXML ( OutputDevice os,
bool  asAlternatives,
bool  withExitTimes 
) const

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]asAlternativesWhether the route shall be saved as route alternatives
[in]withExitTimeswhether exit times for the edges shall be written
Exceptions
IOErrorIf something fails (not yet implemented)

Definition at line 135 of file ROVehicle.cpp.

References OutputDevice::closeTag(), Parameterised::getMap(), OptionsCont::getOptions(), myParameter, myRoute, OutputDevice::openTag(), SUMO_ATTR_KEY, SUMO_ATTR_VALUE, SUMO_TAG_PARAM, SUMOReal, SUMOVehicleParameter::write(), OutputDevice::writeAttr(), SUMOVehicleParameter::writeStops(), and RORouteDef::writeXMLDefinition().

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

void ROVehicle::saveTypeAsXML ( OutputDevice os,
OutputDevice *const  altos,
OutputDevice *const  typeos 
) const

Saves 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 116 of file ROVehicle.cpp.

References myType, SUMOVTypeParameter::saved, and SUMOVTypeParameter::write().

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

void ROVehicle::setRoutingSuccess ( const bool  val)
inline

Definition at line 166 of file ROVehicle.h.

References myRoutingSuccess.

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

Field Documentation

SUMOVehicleParameter ROVehicle::myParameter
protected

The vehicle's parameter.

Definition at line 184 of file ROVehicle.h.

Referenced by addStop(), getDepart(), getDepartureTime(), getID(), ROVehicle(), and saveAllAsXML().

RORouteDef* const ROVehicle::myRoute
protected

The route the vehicle takes.

Definition at line 190 of file ROVehicle.h.

Referenced by addStop(), getRouteDefinition(), and saveAllAsXML().

bool ROVehicle::myRoutingSuccess
protected

Whether the last routing was successful.

Definition at line 196 of file ROVehicle.h.

Referenced by getRoutingSuccess(), and setRoutingSuccess().

ConstROEdgeVector ROVehicle::myStopEdges
protected

The edges where the vehicle stops.

Definition at line 193 of file ROVehicle.h.

Referenced by addStop(), and getStopEdges().

const SUMOVTypeParameter* const ROVehicle::myType
protected

The type of the vehicle.

Definition at line 187 of file ROVehicle.h.

Referenced by getMaxSpeed(), getType(), and saveTypeAsXML().


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