SUMO - Simulation of Urban MObility
RORoutable Class Referenceabstract

A routable thing such as a vehicle or person. More...

#include <RORoutable.h>

Inheritance diagram for RORoutable:
Inheritance graph
Collaboration diagram for RORoutable:
Collaboration graph

Public Member Functions

virtual void computeRoute (const RORouterProvider &provider, const bool removeLoops, MsgHandler *errorHandler)=0
 
SUMOTime getDepart () const
 Returns the time the vehicle starts at, -1 for triggered vehicles. More...
 
virtual const ROEdgegetDepartEdge () const =0
 
const std::string & getID () const
 Returns the id of the vehicle. More...
 
double getMaxSpeed () const
 Returns the vehicle's maximum speed. More...
 
bool getRoutingSuccess () const
 
const SUMOVTypeParametergetType () const
 Returns the type of the vehicle. More...
 
SUMOVehicleClass getVClass () const
 
 RORoutable (const SUMOVehicleParameter &pars, const SUMOVTypeParameter *type)
 Constructor. 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 ~RORoutable ()
 Destructor. More...
 

Protected Member Functions

virtual void saveAsXML (OutputDevice &os, OutputDevice *const typeos, bool asAlternatives, OptionsCont &options) const =0
 Saves the complete routable description. 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

RORoutableoperator= (const RORoutable &src)
 Invalidated assignment operator. More...
 
 RORoutable (const RORoutable &src)
 Invalidated copy constructor. More...
 

Detailed Description

A routable thing such as a vehicle or person.

Definition at line 62 of file RORoutable.h.

Constructor & Destructor Documentation

◆ RORoutable() [1/2]

RORoutable::RORoutable ( const SUMOVehicleParameter pars,
const SUMOVTypeParameter type 
)
inline

Constructor.

Parameters
[in]parsParameter of this routable
[in]typeThe type of the routable

Definition at line 69 of file RORoutable.h.

◆ ~RORoutable()

virtual RORoutable::~RORoutable ( )
inlinevirtual

Destructor.

Definition at line 74 of file RORoutable.h.

◆ RORoutable() [2/2]

RORoutable::RORoutable ( const RORoutable src)
private

Invalidated copy constructor.

Member Function Documentation

◆ computeRoute()

virtual void RORoutable::computeRoute ( const RORouterProvider provider,
const bool  removeLoops,
MsgHandler errorHandler 
)
pure virtual

◆ getDepart()

SUMOTime RORoutable::getDepart ( ) const
inline

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 myParameter.

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

◆ getDepartEdge()

virtual const ROEdge* RORoutable::getDepartEdge ( ) const
pure virtual

Implemented in ROPerson, and ROVehicle.

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

◆ getID()

◆ getMaxSpeed()

double RORoutable::getMaxSpeed ( ) const
inline

Returns the vehicle's maximum speed.

Definition at line 112 of file RORoutable.h.

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

Referenced by RONet::createBulkRouteRequests().

◆ getRoutingSuccess()

bool RORoutable::getRoutingSuccess ( ) const
inline

Definition at line 144 of file RORoutable.h.

References myRoutingSuccess, and saveAsXML().

Referenced by RONet::saveAndRemoveRoutesUntil().

◆ getType()

const SUMOVTypeParameter* RORoutable::getType ( ) const
inline

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 myType.

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

◆ getVClass()

SUMOVehicleClass RORoutable::getVClass ( ) const
inline

◆ operator=()

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

Invalidated assignment operator.

◆ saveAsXML()

virtual void RORoutable::saveAsXML ( OutputDevice os,
OutputDevice *const  typeos,
bool  asAlternatives,
OptionsCont options 
) const
protectedpure virtual

Saves the complete routable description.

Saves the routable itself including the route and stops.

Parameters
[in]osThe routes or alternatives output device to store the routable's description into
[in]typeosThe types - output device to store additional 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)

Implemented in ROPerson, and ROVehicle.

Referenced by getRoutingSuccess(), and write().

◆ write()

void RORoutable::write ( OutputDevice os,
OutputDevice *const  altos,
OutputDevice *const  typeos,
OptionsCont options 
) const
inline

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 saveAsXML().

Referenced by RONet::saveAndRemoveRoutesUntil().

Field Documentation

◆ myParameter

◆ myRoutingSuccess

bool RORoutable::myRoutingSuccess
protected

Whether the last routing was successful.

Definition at line 171 of file RORoutable.h.

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

◆ myType

const SUMOVTypeParameter* const RORoutable::myType
protected

The type of the vehicle.

Definition at line 168 of file RORoutable.h.

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


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