SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SUMOVTypeParameter.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Structure representing possible vehicle parameter
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef SUMOVTypeParameter_h
23 #define SUMOVTypeParameter_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
36 #include <map>
38 #include <utils/common/RGBColor.h>
39 #include <utils/common/SUMOTime.h>
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class OutputDevice;
46 class OptionsCont;
47 
48 
49 // ===========================================================================
50 // value definitions
51 // ===========================================================================
52 const int VTYPEPARS_LENGTH_SET = 1;
53 const int VTYPEPARS_MINGAP_SET = 2;
54 const int VTYPEPARS_MAXSPEED_SET = 2 << 2;
55 const int VTYPEPARS_PROBABILITY_SET = 2 << 3;
56 const int VTYPEPARS_SPEEDFACTOR_SET = 2 << 4;
57 const int VTYPEPARS_SPEEDDEVIATION_SET = 2 << 5;
58 const int VTYPEPARS_EMISSIONCLASS_SET = 2 << 6;
59 const int VTYPEPARS_COLOR_SET = 2 << 7;
60 const int VTYPEPARS_VEHICLECLASS_SET = 2 << 8;
61 const int VTYPEPARS_WIDTH_SET = 2 << 9;
62 const int VTYPEPARS_HEIGHT_SET = 2 << 10;
63 const int VTYPEPARS_SHAPE_SET = 2 << 11;
64 const int VTYPEPARS_OSGFILE_SET = 2 << 12;
65 const int VTYPEPARS_IMGFILE_SET = 2 << 13;
66 const int VTYPEPARS_IMPATIENCE_SET = 2 << 14;
67 const int VTYPEPARS_LANE_CHANGE_MODEL_SET = 2 << 15;
68 const int VTYPEPARS_PERSON_CAPACITY = 2 << 16;
69 const int VTYPEPARS_BOARDING_DURATION = 2 << 17;
70 const int VTYPEPARS_CONTAINER_CAPACITY = 2 << 18;
71 const int VTYPEPARS_LOADING_DURATION = 2 << 19;
72 const int VTYPEPARS_CAR_FOLLOW_MODEL = 2 << 20;
73 const int VTYPEPARS_MAXSPEED_LAT_SET = 2 << 21;
74 const int VTYPEPARS_LATALIGNMENT_SET = 2 << 22;
75 const int VTYPEPARS_MINGAP_LAT_SET = 2 << 23;
76 
77 
78 // ===========================================================================
79 // struct definitions
80 // ===========================================================================
86 public:
91  SUMOVTypeParameter(const std::string& vtid, const SUMOVehicleClass vc = SVC_IGNORING);
92 
93 
98  bool wasSet(int what) const {
99  return (setParameter & what) != 0;
100  }
101 
102 
108  void write(OutputDevice& dev) const;
109 
112  void validateCFParameter() const;
113 
114 
120  SUMOReal getCFParam(const SumoXMLAttr attr, const SUMOReal defaultValue) const;
121 
127  SUMOReal getLCParam(const SumoXMLAttr attr, const SUMOReal defaultValue) const;
128 
129 
131  std::string id;
132 
161 
164 
167 
170 
173 
175  std::string osgFile;
176 
178  std::string imgFile;
180 
181 
184 
186  typedef std::map<SumoXMLAttr, SUMOReal> SubParams;
188  SubParams cfParameter;
190  SubParams lcParameter;
191 
194 
201 
204 
205 
207  mutable bool saved;
208 
210  mutable bool onlyReferenced;
211 
218 
225 
232 
234  static const SUMOVTypeParameter& getDefault();
235 
236 };
237 
238 #endif
239 
240 /****************************************************************************/
241 
const int VTYPEPARS_MAXSPEED_SET
const int VTYPEPARS_MINGAP_SET
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLTag cfModel
The enum-representation of the car-following model to use.
const int VTYPEPARS_LATALIGNMENT_SET
long long int SUMOTime
Definition: SUMOTime.h:43
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
SUMOVehicleShape shape
This class' shape.
Structure representing possible vehicle parameter.
const int VTYPEPARS_MINGAP_LAT_SET
SUMOReal getCFParam(const SumoXMLAttr attr, const SUMOReal defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
bool saved
Information whether this type was already saved (needed by routers)
SUMOVTypeParameter(const std::string &vtid, const SUMOVehicleClass vc=SVC_IGNORING)
Constructor.
SUMOReal speedDev
The standard deviation for speed variations.
int containerCapacity
The container capacity of the vehicle.
SUMOReal length
The physical vehicle length.
const int VTYPEPARS_BOARDING_DURATION
SUMOVehicleClass vehicleClass
The vehicle's class.
SUMOReal getLCParam(const SumoXMLAttr attr, const SUMOReal defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
SUMOReal width
This class' width.
const int VTYPEPARS_CAR_FOLLOW_MODEL
const int VTYPEPARS_OSGFILE_SET
const int VTYPEPARS_MAXSPEED_LAT_SET
const int VTYPEPARS_PROBABILITY_SET
LateralAlignment
Numbers representing special SUMO-XML-attribute values Information how vehicles align themselves with...
const int VTYPEPARS_LANE_CHANGE_MODEL_SET
static SUMOReal getDefaultImperfection(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default driver's imperfection (sigma or epsilon in Krauss' model) for the given vehicle c...
LaneChangeModel
SUMOReal speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street...
SUMOTime boardingDuration
The time a person needs to board the vehicle.
std::string osgFile
3D model file for this class
int SUMOEmissionClass
SUMOReal maxSpeedLat
The vehicle type's maximum lateral speed [m/s].
std::string imgFile
Image file for this class.
const int VTYPEPARS_SPEEDDEVIATION_SET
const int VTYPEPARS_LOADING_DURATION
const int VTYPEPARS_CONTAINER_CAPACITY
An upper class for objects with additional parameters.
Definition: Parameterised.h:47
bool onlyReferenced
Information whether this is a type-stub, being only referenced but not defined (needed by routers) ...
const int VTYPEPARS_SPEEDFACTOR_SET
void write(OutputDevice &dev) const
Writes the vtype.
SUMOReal maxSpeed
The vehicle type's maximum speed [m/s].
std::map< SumoXMLAttr, SUMOReal > SubParams
sub-model parameters
int personCapacity
The person capacity of the vehicle.
int setParameter
Information for the router which parameter were set.
static SUMOReal getDefaultDecel(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default deceleration for the given vehicle class This needs to be a function because the ...
SUMOReal impatience
The vehicle's impatience (willingness to obstruct others)
SUMOReal minGapLat
The vehicle type's minimum lateral gap [m].
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
bool wasSet(int what) const
Returns whether the given parameter was set.
SUMOReal defaultProbability
The probability when being added to a distribution without an explicit probability.
const int VTYPEPARS_IMGFILE_SET
SubParams cfParameter
Car-following parameter.
SUMOTime loadingDuration
The time a container needs to get loaded on the vehicle.
RGBColor color
The color.
A storage for options typed value containers)
Definition: OptionsCont.h:99
std::string id
The vehicle type's id.
const int VTYPEPARS_PERSON_CAPACITY
LateralAlignment latAlignment
The vehicles desired lateral alignment.
const int VTYPEPARS_HEIGHT_SET
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:214
static SUMOReal getDefaultAccel(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default acceleration for the given vehicle class This needs to be a function because the ...
void validateCFParameter() const
Validates stored car-following parameter.
const int VTYPEPARS_WIDTH_SET
LaneChangeModel lcModel
The lane-change model to use.
static const SUMOVTypeParameter & getDefault()
return the default parameters, this is a function due to the http://www.parashift.com/c++-faq/static-init-order.html
SUMOReal height
This class' height.
const int VTYPEPARS_LENGTH_SET
const int VTYPEPARS_VEHICLECLASS_SET
const int VTYPEPARS_EMISSIONCLASS_SET
const int VTYPEPARS_COLOR_SET
const int VTYPEPARS_SHAPE_SET
SubParams lcParameter
Lane-changing parameter.
SUMOEmissionClass emissionClass
The emission class of this vehicle.
vehicles ignoring classes
const int VTYPEPARS_IMPATIENCE_SET
SUMOReal minGap
This class' free space in front of the vehicle itself.