#include <ROVehicle.h>
Definition at line 57 of file ROVehicle.h.
Public Member Functions | |
| virtual ROVehicle * | copy (const std::string &id, unsigned int depTime, RORouteDef *newRoute) throw () |
| Returns a copy of the vehicle using a new id, departure time and route. | |
| SUMOTime | getDepartureTime () const throw () |
| Returns the time the vehicle starts at. | |
| const std::string & | getID () const throw () |
| Returns the id of the vehicle. | |
| RORouteDef *const | getRouteDefinition () const throw () |
| Returns the definition of the route the vehicle takes. | |
| const SUMOVTypeParameter *const | getType () const throw () |
| Returns the type of the vehicle. | |
| ROVehicle (const SUMOVehicleParameter &pars, RORouteDef *route, SUMOVTypeParameter *type) throw () | |
| Constructor. | |
| void | saveAllAsXML (SUMOAbstractRouter< ROEdge, ROVehicle > &router, OutputDevice &os, OutputDevice *const altos, bool withExitTimes) const throw (IOError) |
| Saves the complete vehicle description. | |
| virtual | ~ROVehicle () throw () |
| Destructor. | |
Protected Attributes | |
| SUMOVehicleParameter | myParameter |
| The vehicle's parameter. | |
| RORouteDef * | myRoute |
| The route the vehicle takes. | |
| SUMOVTypeParameter * | myType |
| The type of the vehicle. | |
Private Member Functions | |
| ROVehicle & | operator= (const ROVehicle &src) |
| Invalidated assignment operator. | |
| ROVehicle (const ROVehicle &src) | |
| Invalidated copy constructor. | |
| ROVehicle::ROVehicle | ( | const SUMOVehicleParameter & | pars, | |
| RORouteDef * | route, | |||
| SUMOVTypeParameter * | type | |||
| ) | throw () |
Constructor.
| [in] | pars | Parameter of this vehicle |
| [in] | route | The definition of the route the vehicle shall use |
| [in] | type | The type of the vehicle |
Definition at line 52 of file ROVehicle.cpp.
Referenced by copy().
00054 : myParameter(pars), myType(type), myRoute(route) {}
| ROVehicle::~ROVehicle | ( | ) | throw () [virtual] |
| ROVehicle::ROVehicle | ( | const ROVehicle & | src | ) | [private] |
Invalidated copy constructor.
| ROVehicle * ROVehicle::copy | ( | const std::string & | id, | |
| unsigned int | depTime, | |||
| RORouteDef * | newRoute | |||
| ) | throw () [virtual] |
Returns a copy of the vehicle using a new id, departure time and route.
| [in] | id | the new id to use |
| [in] | depTime | The new vehicle's departure time |
| [in] | newRoute | The new vehicle's route |
Definition at line 94 of file ROVehicle.cpp.
References SUMOVehicleParameter::depart, SUMOVehicleParameter::id, myParameter, myType, and ROVehicle().
Referenced by RORDGenerator_ODAmounts::FlowDef::addSingleRoute().
00095 { 00096 SUMOVehicleParameter pars(myParameter); 00097 pars.id = id; 00098 pars.depart = depTime; 00099 return new ROVehicle(pars, newRoute, myType); 00100 }
| SUMOTime ROVehicle::getDepartureTime | ( | ) | const throw () [inline] |
Returns the time the vehicle starts at.
Definition at line 110 of file ROVehicle.h.
References SUMOVehicleParameter::depart, and myParameter.
Referenced by RONet::computeRoute(), RONet::saveAndRemoveRoutesUntil(), RORouteDef_Complete::writeXMLDefinition(), RORouteDef_Alternatives::writeXMLDefinition(), and RORoute::writeXMLDefinition().
00110 { 00111 return myParameter.depart; 00112 }
| const std::string& ROVehicle::getID | ( | ) | const throw () [inline] |
Returns the id of the vehicle.
Definition at line 101 of file ROVehicle.h.
References SUMOVehicleParameter::id, and myParameter.
Referenced by RORouteDef_Alternatives::addAlternative(), RORDGenerator_ODAmounts::FlowDef::addSingleRoute(), RORouteDef_Complete::buildCurrentRoute(), RONet::computeRoute(), ROVehicleCont::erase(), and RONet::saveAndRemoveRoutesUntil().
00101 { 00102 return myParameter.id; 00103 }
| RORouteDef* const ROVehicle::getRouteDefinition | ( | ) | const throw () [inline] |
Returns the definition of the route the vehicle takes.
Definition at line 81 of file ROVehicle.h.
References myRoute.
Referenced by RONet::computeRoute().
00081 { 00082 return myRoute; 00083 }
| const SUMOVTypeParameter* const ROVehicle::getType | ( | ) | const throw () [inline] |
Returns the type of the vehicle.
Definition at line 92 of file ROVehicle.h.
References myType.
00092 { 00093 return myType; 00094 }
Invalidated assignment operator.
| void ROVehicle::saveAllAsXML | ( | SUMOAbstractRouter< ROEdge, ROVehicle > & | router, | |
| OutputDevice & | os, | |||
| OutputDevice *const | altos, | |||
| bool | withExitTimes | |||
| ) | const throw (IOError) |
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.
| [in] | os | The routes - output device to store the vehicle's description into |
| [in] | altos | The route alternatives - output device to store the vehicle's description into |
| [in] | route | !!!describe |
| IOError | If something fails (not yet implemented) |
Definition at line 61 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().
00062 { 00063 // check whether the vehicle's type was saved before 00064 if (myType!=0&&!myType->saved) { 00065 // ... save if not 00066 myType->write(os); 00067 if (altos!=0) { 00068 myType->write(*altos); 00069 } 00070 myType->saved = true; 00071 } 00072 00073 // write the vehicle (new style, with included routes) 00074 myParameter.writeAs("vehicle", os, OptionsCont::getOptions()); 00075 if (altos!=0) { 00076 myParameter.writeAs("vehicle", *altos, OptionsCont::getOptions()); 00077 } 00078 00079 // check whether the route shall be saved 00080 if (!myRoute->isSaved()) { 00081 myRoute->writeXMLDefinition(router, os, this, false, withExitTimes); 00082 if (altos!=0) { 00083 myRoute->writeXMLDefinition(router, *altos, this, true, withExitTimes); 00084 } 00085 } 00086 os.closeTag(); 00087 if (altos!=0) { 00088 altos->closeTag(); 00089 } 00090 }
SUMOVehicleParameter ROVehicle::myParameter [protected] |
The vehicle's parameter.
Definition at line 145 of file ROVehicle.h.
Referenced by copy(), getDepartureTime(), getID(), and saveAllAsXML().
RORouteDef* ROVehicle::myRoute [protected] |
The route the vehicle takes.
Definition at line 151 of file ROVehicle.h.
Referenced by getRouteDefinition(), and saveAllAsXML().
SUMOVTypeParameter* ROVehicle::myType [protected] |
The type of the vehicle.
Definition at line 148 of file ROVehicle.h.
Referenced by copy(), getType(), and saveAllAsXML().
1.5.6