SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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-sim.org/
12 // Copyright (C) 2001-2013 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>
37 #include "SUMOVehicleClass.h"
38 #include "RGBColor.h"
39 #include "SUMOTime.h"
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class OutputDevice;
47 class OptionsCont;
48 
49 
50 // ===========================================================================
51 // value definitions
52 // ===========================================================================
53 const int VTYPEPARS_LENGTH_SET = 1;
54 const int VTYPEPARS_MINGAP_SET = 2;
55 const int VTYPEPARS_MAXSPEED_SET = 2 << 2;
56 const int VTYPEPARS_PROBABILITY_SET = 2 << 3;
57 const int VTYPEPARS_SPEEDFACTOR_SET = 2 << 4;
58 const int VTYPEPARS_SPEEDDEVIATION_SET = 2 << 5;
59 const int VTYPEPARS_EMISSIONCLASS_SET = 2 << 6;
60 const int VTYPEPARS_COLOR_SET = 2 << 7;
61 const int VTYPEPARS_VEHICLECLASS_SET = 2 << 8;
62 const int VTYPEPARS_WIDTH_SET = 2 << 9;
63 const int VTYPEPARS_HEIGHT_SET = 2 << 10;
64 const int VTYPEPARS_SHAPE_SET = 2 << 11;
65 const int VTYPEPARS_OSGFILE_SET = 2 << 12;
66 const int VTYPEPARS_IMGFILE_SET = 2 << 13;
67 const int VTYPEPARS_IMPATIENCE_SET = 2 << 14;
68 
69 
70 // ===========================================================================
71 // struct definitions
72 // ===========================================================================
78 public:
84 
85 
90  bool wasSet(int what) const {
91  return (setParameter & what) != 0;
92  }
93 
94 
100  void write(OutputDevice& dev) const;
101 
104  void validateCFParameter() const;
105 
106 
112  SUMOReal get(const SumoXMLAttr attr, const SUMOReal defaultValue) const;
113 
114 
116  std::string id;
117 
138 
139 
142 
145 
148 
151 
153  std::string osgFile;
154 
156  std::string imgFile;
158 
159 
162 
164  typedef std::map<SumoXMLAttr, SUMOReal> CFParams;
166 
168  std::string lcModel;
169 
172 
173 
175  mutable bool saved;
176 
178  mutable bool onlyReferenced;
179 
180 };
181 
182 #endif
183 
184 /****************************************************************************/
185 
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.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
SUMOVehicleShape shape
This class&#39; shape.
Structure representing possible vehicle parameter.
bool saved
Information whether this type was already saved (needed by routers)
SUMOReal speedDev
The standard deviation for speed variations.
SUMOReal length
The physical vehicle length.
SUMOVehicleClass vehicleClass
The vehicle&#39;s class.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
SUMOReal width
This class&#39; width.
const int VTYPEPARS_OSGFILE_SET
const int VTYPEPARS_PROBABILITY_SET
SUMOEmissionClass
Definition of vehicle emission classes.
SUMOReal speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street...
std::string osgFile
3D model file for this class
std::string lcModel
The name of the lane-change model to use.
std::string imgFile
Image file for this class.
SUMOVTypeParameter()
Constructor.
const int VTYPEPARS_SPEEDDEVIATION_SET
An upper class for objects with additional parameters.
Definition: Parameterised.h:46
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&#39;s maximum speed [m/s].
int setParameter
Information for the router which parameter were set.
SUMOReal impatience
The vehicle&#39;s impatience (willingness to obstruct others)
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
RGBColor color
The color.
A storage for options typed value containers)
Definition: OptionsCont.h:108
std::map< SumoXMLAttr, SUMOReal > CFParams
Car-following parameter.
std::string id
The vehicle type&#39;s id.
const int VTYPEPARS_HEIGHT_SET
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
#define SUMOReal
Definition: config.h:221
void validateCFParameter() const
Validates stored car-following parameter.
const int VTYPEPARS_WIDTH_SET
SUMOReal height
This class&#39; 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
SUMOEmissionClass emissionClass
The emission class of this vehicle.
const int VTYPEPARS_IMPATIENCE_SET
SUMOReal minGap
This class&#39; free space in front of the vehicle itself.