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

virtual ROVehiclecopy (const std::string &id, unsigned int depTime, RORouteDef *newRoute) const
 Returns a copy of the vehicle using a new id, departure time and route. More...
 
SUMOTime getDepartureTime () const
 Returns the time the vehicle starts at. 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...
 
const SUMOVTypeParametergetType () const
 Returns the type of the vehicle. More...
 
SUMOVehicleClass getVClass () const
 
 ROVehicle (const SUMOVehicleParameter &pars, RORouteDef *route, const SUMOVTypeParameter *type)
 Constructor. More...
 
void saveAllAsXML (OutputDevice &os, OutputDevice *const altos, OutputDevice *const typeos, bool withExitTimes) const
 Saves the complete vehicle description. More...
 
virtual ~ROVehicle ()
 Destructor. More...
 

Protected Attributes

SUMOVehicleParameter myParameter
 The vehicle's parameter. More...
 
RORouteDef *const myRoute
 The route the vehicle takes. More...
 
const SUMOVTypeParameter *const myType
 The type of the vehicle. More...
 

Private Member Functions

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 
)

Constructor.

Parameters
[in]parsParameter of this vehicle
[in]routeThe definition of the route the vehicle shall use
[in]typeThe type of the vehicle
Todo:
Why is the vehicle builder given?

Definition at line 54 of file ROVehicle.cpp.

Referenced by copy().

ROVehicle::~ROVehicle ( )
virtual

Destructor.

Definition at line 59 of file ROVehicle.cpp.

ROVehicle::ROVehicle ( const ROVehicle src)
private

Invalidated copy constructor.

Member Function Documentation

ROVehicle * ROVehicle::copy ( const std::string &  id,
unsigned int  depTime,
RORouteDef newRoute 
) const
virtual

Returns a copy of the vehicle using a new id, departure time and route.

Parameters
[in]idthe new id to use
[in]depTimeThe new vehicle's departure time
[in]newRouteThe new vehicle's route
Returns
The new vehicle
Todo:
Is this used? What for if everything is replaced?

Definition at line 106 of file ROVehicle.cpp.

References SUMOVehicleParameter::depart, SUMOVehicleParameter::id, myParameter, myType, and ROVehicle().

Referenced by RORDGenerator_ODAmounts::FlowDef::addSingleRoute().

SUMOTime ROVehicle::getDepartureTime ( ) const
inline

Returns the time the vehicle starts at.

Returns
The vehicle's depart time

Definition at line 113 of file ROVehicle.h.

References SUMOVehicleParameter::depart, and myParameter.

Referenced by ROLogitCalculator::calculateProbabilities(), 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 100 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 84 of file ROVehicle.h.

References myRoute.

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

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

Definition at line 122 of file ROVehicle.h.

References DEFAULT_VEH_CLASS, getType(), 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 63 of file ROVehicle.cpp.

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

Referenced by RONet::saveAndRemoveRoutesUntil().

Field Documentation

SUMOVehicleParameter ROVehicle::myParameter
protected

The vehicle's parameter.

Definition at line 157 of file ROVehicle.h.

Referenced by copy(), getDepartureTime(), getID(), and saveAllAsXML().

RORouteDef* const ROVehicle::myRoute
protected

The route the vehicle takes.

Definition at line 163 of file ROVehicle.h.

Referenced by getRouteDefinition(), and saveAllAsXML().

const SUMOVTypeParameter* const ROVehicle::myType
protected

The type of the vehicle.

Definition at line 160 of file ROVehicle.h.

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


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