SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ROVehicle Class Reference

A vehicle as used by router. More...

#include <ROVehicle.h>

Public Member Functions

SUMOTime getDepartureTime () const
 Returns the time the vehicle starts at.
const std::string & getID () const
 Returns the id of the vehicle.
SUMOReal getMaxSpeed () const
 Returns the vehicle's maximum speed.
RORouteDefgetRouteDefinition () const
 Returns the definition of the route the vehicle takes.
const std::vector< const
ROEdge * > & 
getStopEdges () const
const SUMOVTypeParametergetType () const
 Returns the type of the vehicle.
SUMOVehicleClass getVClass () const
 ROVehicle (const SUMOVehicleParameter &pars, RORouteDef *route, const SUMOVTypeParameter *type, const RONet *net)
 Constructor.
void saveAllAsXML (OutputDevice &os, OutputDevice *const altos, OutputDevice *const typeos, bool withExitTimes) const
 Saves the complete vehicle description.
virtual ~ROVehicle ()
 Destructor.

Protected Attributes

SUMOVehicleParameter myParameter
 The vehicle's parameter.
RORouteDef *const myRoute
 The route the vehicle takes.
std::vector< const ROEdge * > myStopEdges
 The edges where the vehicle stops.
const SUMOVTypeParameter *const myType
 The type of the vehicle.

Private Member Functions

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

Detailed Description

A vehicle as used by router.

Definition at line 59 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 ROVehicle().

SUMOTime ROVehicle::getDepartureTime ( ) const
inline

Returns the time the vehicle starts at.

Returns
The vehicle's depart time

Definition at line 111 of file ROVehicle.h.

References SUMOVehicleParameter::depart, and myParameter.

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

const std::string& ROVehicle::getID ( ) const
inline
SUMOReal ROVehicle::getMaxSpeed ( ) const

Returns the vehicle's maximum speed.

Definition at line 157 of file ROVehicle.cpp.

References SUMOVTypeParameter::maxSpeed, and myType.

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

References myRoute.

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

const std::vector<const ROEdge*>& ROVehicle::getStopEdges ( ) const
inline

Definition at line 115 of file ROVehicle.h.

References myStopEdges.

Referenced by RORouteDef::repairCurrentRoute().

const SUMOVTypeParameter* ROVehicle::getType ( ) const
inline
SUMOVehicleClass ROVehicle::getVClass ( ) const
inline

Definition at line 123 of file ROVehicle.h.

References getType(), SVC_IGNORING, and SUMOVTypeParameter::vehicleClass.

Referenced by ROEdge::prohibits().

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

Invalidated assignment operator.

void ROVehicle::saveAllAsXML ( OutputDevice os,
OutputDevice *const  altos,
OutputDevice *const  typeos,
bool  withExitTimes 
) const

Saves the complete vehicle description.

Saves the vehicle type if it was not saved before. Saves the vehicle route if it was not saved before. Saves the vehicle itself.

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

Definition at line 116 of file ROVehicle.cpp.

References OutputDevice::closeTag(), OptionsCont::getOptions(), ReferencedItem::isSaved(), myParameter, myRoute, myType, SUMOVTypeParameter::saved, SUMOVTypeParameter::write(), SUMOVehicleParameter::write(), SUMOVehicleParameter::writeStops(), and RORouteDef::writeXMLDefinition().

Referenced by RONet::saveAndRemoveRoutesUntil().

Field Documentation

SUMOVehicleParameter ROVehicle::myParameter
protected

The vehicle's parameter.

Definition at line 155 of file ROVehicle.h.

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

RORouteDef* const ROVehicle::myRoute
protected

The route the vehicle takes.

Definition at line 161 of file ROVehicle.h.

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

std::vector<const ROEdge*> ROVehicle::myStopEdges
protected

The edges where the vehicle stops.

Definition at line 164 of file ROVehicle.h.

Referenced by addStop(), and getStopEdges().

const SUMOVTypeParameter* const ROVehicle::myType
protected

The type of the vehicle.

Definition at line 158 of file ROVehicle.h.

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


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