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-2014 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 const int VTYPEPARS_LANE_CHANGE_MODEL_SET = 2 << 15;
69 
70 
71 // ===========================================================================
72 // struct definitions
73 // ===========================================================================
79 public:
84  SUMOVTypeParameter(const std::string& vtid, const SUMOVehicleClass vc = SVC_IGNORING);
85 
86 
91  bool wasSet(int what) const {
92  return (setParameter & what) != 0;
93  }
94 
95 
101  void write(OutputDevice& dev) const;
102 
105  void validateCFParameter() const;
106 
107 
113  SUMOReal get(const SumoXMLAttr attr, const SUMOReal defaultValue) const;
114 
115 
117  std::string id;
118 
139 
140 
143 
146 
149 
152 
154  std::string osgFile;
155 
157  std::string imgFile;
159 
160 
163 
165  typedef std::map<SumoXMLAttr, SUMOReal> CFParams;
167 
170 
173 
174 
176  mutable bool saved;
177 
179  mutable bool onlyReferenced;
180 
187 
194 
201 
203  static const SUMOVTypeParameter& getDefault();
204 
205 };
206 
207 #endif
208 
209 /****************************************************************************/
210