SUMO - Simulation of Urban MObility
SUMOVehicleParameter Class Reference

Structure representing possible vehicle parameter. More...

#include <SUMOVehicleParameter.h>

Data Structures

struct  Stop
 Definition of vehicle stop (position and duration) More...

Public Member Functions

bool defaultOptionOverrides (const OptionsCont &oc, const std::string &optionName) const
 Returns whether the defaults shall be used.
 SUMOVehicleParameter ()
 Constructor.
bool wasSet (int what) const
 Returns whether the given parameter was set.
void writeAs (const std::string &xmlElem, OutputDevice &dev, const OptionsCont &oc) const
 Writes the parameters as a beginning element.

Static Public Member Functions

Depart/arrival-attributes verification
static bool departlaneValidate (const std::string &val)
 Validates a given departlane value.
static bool departposValidate (const std::string &val)
 Validates a given departpos value.
static bool departspeedValidate (const std::string &val)
 Validates a given departspeed value.
static bool arrivallaneValidate (const std::string &val)
 Validates a given arrivallane value.
static bool arrivalposValidate (const std::string &val)
 Validates a given arrivalpos value.
static bool arrivalspeedValidate (const std::string &val)
 Validates a given arrivalspeed value.

Data Fields

RGBColor color
 The vehicle's color.
std::string fromTaz
 The vehicle's origin zone (district)
std::string id
 The vehicle's id.
std::string line
 The vehicle's line (mainly for public transport)
std::string routeid
 The vehicle's route id.
int setParameter
 Information for the router which parameter were set.
std::vector< Stopstops
 List of the stops the vehicle will make.
std::string toTaz
 The vehicle's destination zone (district)
std::string vtypeid
 The vehicle's type id.
Departure definition
SUMOTime depart
 The vehicle's departure time.
DepartDefinition departProcedure
 Information how the vehicle shall choose the depart time.
int departLane
 (optional) The lane the vehicle shall depart from (index in edge)
DepartLaneDefinition departLaneProcedure
 Information how the vehicle shall choose the lane to depart from.
SUMOReal departPos
 (optional) The position the vehicle shall depart from
DepartPosDefinition departPosProcedure
 Information how the vehicle shall choose the departure position.
SUMOReal departSpeed
 (optional) The initial speed of the vehicle
DepartSpeedDefinition departSpeedProcedure
 Information how the vehicle's initial speed shall be chosen.
Arrival definition
int arrivalLane
 (optional) The lane the vehicle shall arrive on (not used yet)
ArrivalLaneDefinition arrivalLaneProcedure
 Information how the vehicle shall choose the lane to arrive on.
SUMOReal arrivalPos
 (optional) The position the vehicle shall arrive on
ArrivalPosDefinition arrivalPosProcedure
 Information how the vehicle shall choose the arrival position.
SUMOReal arrivalSpeed
 (optional) The final speed of the vehicle (not used yet)
ArrivalSpeedDefinition arrivalSpeedProcedure
 Information how the vehicle's end speed shall be chosen.
Repetition definition
int repetitionNumber
 The number of times the vehicle shall be repeatedly inserted.
int repetitionsDone
 The number of times the vehicle was already inserted.
SUMOReal repetitionOffset
 The time offset between vehicle reinsertions.

Detailed Description

Structure representing possible vehicle parameter.

The fields yielding with "Procedure" describe whether the according value shall be used or another procedure is used to choose the value.

See also:
DepartLaneDefinition
DepartPosDefinition
DepartSpeedDefinition

Definition at line 220 of file SUMOVehicleParameter.h.


Constructor & Destructor Documentation

Constructor.

Initialises the structure with default values

Definition at line 48 of file SUMOVehicleParameter.cpp.

References DEFAULT_VTYPE_ID.


Member Function Documentation

bool SUMOVehicleParameter::arrivallaneValidate ( const std::string &  val) [static]

Validates a given arrivallane value.

Parameters:
[in]valThe arrivallane value to validate
Returns:
Whether the given value is a valid arrivallane definition

Definition at line 295 of file SUMOVehicleParameter.cpp.

References WRITE_ERROR.

Referenced by ROJTRFrame::checkOptions(), RODUAFrame::checkOptions(), and checkOptions().

bool SUMOVehicleParameter::arrivalposValidate ( const std::string &  val) [static]

Validates a given arrivalpos value.

Parameters:
[in]valThe arrivalpos value to validate
Returns:
Whether the given value is a valid arrivalpos definition

Definition at line 311 of file SUMOVehicleParameter.cpp.

References WRITE_ERROR.

Referenced by ROJTRFrame::checkOptions(), RODUAFrame::checkOptions(), and checkOptions().

bool SUMOVehicleParameter::arrivalspeedValidate ( const std::string &  val) [static]

Validates a given arrivalspeed value.

Parameters:
[in]valThe arrivalspeed value to validate
Returns:
Whether the given value is a valid arrivalspeed definition

Definition at line 327 of file SUMOVehicleParameter.cpp.

References WRITE_ERROR.

Referenced by ROJTRFrame::checkOptions(), RODUAFrame::checkOptions(), and checkOptions().

bool SUMOVehicleParameter::defaultOptionOverrides ( const OptionsCont oc,
const std::string &  optionName 
) const

Returns whether the defaults shall be used.

Parameters:
[in]ocThe options to get the options from
[in]optionNameThe name of the option to determine whether its value shall be used
Returns:
Whether the option is set and --defaults-override was set

Definition at line 63 of file SUMOVehicleParameter.cpp.

References OptionsCont::getBool(), and OptionsCont::isSet().

Referenced by writeAs().

bool SUMOVehicleParameter::departlaneValidate ( const std::string &  val) [static]

Validates a given departlane value.

Parameters:
[in]valThe departlane value to validate
Returns:
Whether the given value is a valid departlane definition

Definition at line 247 of file SUMOVehicleParameter.cpp.

References WRITE_ERROR.

Referenced by ROJTRFrame::checkOptions(), RODUAFrame::checkOptions(), and checkOptions().

bool SUMOVehicleParameter::departposValidate ( const std::string &  val) [static]

Validates a given departpos value.

Parameters:
[in]valThe departpos value to validate
Returns:
Whether the given value is a valid departpos definition

Definition at line 263 of file SUMOVehicleParameter.cpp.

References WRITE_ERROR.

Referenced by ROJTRFrame::checkOptions(), RODUAFrame::checkOptions(), and checkOptions().

bool SUMOVehicleParameter::departspeedValidate ( const std::string &  val) [static]

Validates a given departspeed value.

Parameters:
[in]valThe departspeed value to validate
Returns:
Whether the given value is a valid departspeed definition

Definition at line 279 of file SUMOVehicleParameter.cpp.

References WRITE_ERROR.

Referenced by ROJTRFrame::checkOptions(), RODUAFrame::checkOptions(), and checkOptions().

bool SUMOVehicleParameter::wasSet ( int  what) const [inline]

Returns whether the given parameter was set.

Parameters:
[in]whatThe parameter which one asks for
Returns:
Whether the given parameter was set

Definition at line 233 of file SUMOVehicleParameter.h.

References setParameter.

Referenced by MSDevice_Routing::buildVehicleDevices(), RORDLoader_SUMOBase::myCharacters(), RORDLoader_TripDefs::myEndElement(), RORDGenerator_ODAmounts::myEndFlowAmountDef(), MSRouteHandler::myStartElement(), and writeAs().

void SUMOVehicleParameter::writeAs ( const std::string &  xmlElem,
OutputDevice dev,
const OptionsCont oc 
) const

Writes the parameters as a beginning element.

Parameters:
[in]xmlElemThe name of the element to write
[in,out]devThe device to write into
[in]ocThe options to get defaults from
Exceptions:
IOErrornot yet implemented

Definition at line 69 of file SUMOVehicleParameter.cpp.

References ARRIVAL_LANE_CURRENT, ARRIVAL_LANE_DEFAULT, ARRIVAL_LANE_GIVEN, ARRIVAL_POS_DEFAULT, ARRIVAL_POS_GIVEN, ARRIVAL_POS_MAX, ARRIVAL_POS_RANDOM, ARRIVAL_SPEED_CURRENT, ARRIVAL_SPEED_DEFAULT, ARRIVAL_SPEED_GIVEN, arrivalLane, arrivalLaneProcedure, arrivalPos, arrivalPosProcedure, arrivalSpeed, arrivalSpeedProcedure, OutputDevice::closeOpener(), color, defaultOptionOverrides(), depart, DEPART_LANE_ALLOWED_FREE, DEPART_LANE_BEST_FREE, DEPART_LANE_DEFAULT, DEPART_LANE_FREE, DEPART_LANE_GIVEN, DEPART_LANE_RANDOM, DEPART_POS_BASE, DEPART_POS_DEFAULT, DEPART_POS_FREE, DEPART_POS_GIVEN, DEPART_POS_MAX_SPEED_GAP, DEPART_POS_PWAG_GENERIC, DEPART_POS_PWAG_SIMPLE, DEPART_POS_RANDOM, DEPART_POS_RANDOM_FREE, DEPART_SPEED_DEFAULT, DEPART_SPEED_GIVEN, DEPART_SPEED_MAX, DEPART_SPEED_RANDOM, departLane, departLaneProcedure, departPos, departPosProcedure, departSpeed, departSpeedProcedure, fromTaz, OptionsCont::getString(), OptionsCont::isSet(), line, OutputDevice::openTag(), repetitionNumber, repetitionOffset, SUMO_ATTR_ARRIVALLANE, SUMO_ATTR_ARRIVALPOS, SUMO_ATTR_ARRIVALSPEED, SUMO_ATTR_COLOR, SUMO_ATTR_DEPART, SUMO_ATTR_DEPARTLANE, SUMO_ATTR_DEPARTPOS, SUMO_ATTR_DEPARTSPEED, SUMO_ATTR_FROM_TAZ, SUMO_ATTR_ID, SUMO_ATTR_LINE, SUMO_ATTR_PERIOD, SUMO_ATTR_REPNUMBER, SUMO_ATTR_TO_TAZ, SUMO_ATTR_TYPE, time2string(), toString(), toTaz, VEHPARS_ARRIVALLANE_SET, VEHPARS_ARRIVALPOS_SET, VEHPARS_ARRIVALSPEED_SET, VEHPARS_COLOR_SET, VEHPARS_DEPARTLANE_SET, VEHPARS_DEPARTPOS_SET, VEHPARS_DEPARTSPEED_SET, VEHPARS_LINE_SET, VEHPARS_PERIODFREQ_SET, VEHPARS_PERIODNUM_SET, VEHPARS_TAZ_SET, VEHPARS_VTYPE_SET, vtypeid, wasSet(), and OutputDevice::writeAttr().

Referenced by ROVehicle::saveAllAsXML().


Field Documentation

(optional) The lane the vehicle shall arrive on (not used yet)

Definition at line 342 of file SUMOVehicleParameter.h.

Referenced by MSVehicle::getBestLanes(), SUMOVehicleParserHelper::parseCommonAttributes(), and writeAs().

Information how the vehicle shall choose the lane to arrive on.

Definition at line 344 of file SUMOVehicleParameter.h.

Referenced by MSVehicle::getBestLanes(), SUMOVehicleParserHelper::parseCommonAttributes(), and writeAs().

(optional) The position the vehicle shall arrive on

Definition at line 346 of file SUMOVehicleParameter.h.

Referenced by MSBaseVehicle::calculateArrivalPos(), SUMOVehicleParserHelper::parseCommonAttributes(), and writeAs().

Information how the vehicle shall choose the arrival position.

Definition at line 348 of file SUMOVehicleParameter.h.

Referenced by MSBaseVehicle::calculateArrivalPos(), SUMOVehicleParserHelper::parseCommonAttributes(), and writeAs().

(optional) The lane the vehicle shall depart from (index in edge)

Definition at line 324 of file SUMOVehicleParameter.h.

Referenced by MSEdge::getDepartLane(), SUMOVehicleParserHelper::parseCommonAttributes(), TraCIServerAPI_Vehicle::processSet(), and writeAs().

The number of times the vehicle was already inserted.

Definition at line 362 of file SUMOVehicleParameter.h.

Referenced by MSInsertionControl::checkFlows(), and MSRouteHandler::closeFlow().

List of the stops the vehicle will make.

Definition at line 406 of file SUMOVehicleParameter.h.

Referenced by MSRouteHandler::addStop(), and MSVehicle::MSVehicle().


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines