SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SUMOVehicleParameter.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // Structure representing possible vehicle parameter
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
13 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef SUMOVehicleParameter_h
24 #define SUMOVehicleParameter_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <string>
37 #include "SUMOVehicleClass.h"
38 #include "RGBColor.h"
39 #include "SUMOTime.h"
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class OutputDevice;
46 class OptionsCont;
47 
48 // ===========================================================================
49 // value definitions
50 // ===========================================================================
51 const int VEHPARS_COLOR_SET = 1;
52 const int VEHPARS_VTYPE_SET = 2;
53 const int VEHPARS_DEPARTLANE_SET = 2 << 2;
54 const int VEHPARS_DEPARTPOS_SET = 2 << 3;
55 const int VEHPARS_DEPARTSPEED_SET = 2 << 4;
56 const int VEHPARS_PERIODNUM_SET = 2 << 5;
57 const int VEHPARS_PERIODFREQ_SET = 2 << 6;
58 const int VEHPARS_ROUTE_SET = 2 << 7;
59 const int VEHPARS_ARRIVALLANE_SET = 2 << 8;
60 const int VEHPARS_ARRIVALPOS_SET = 2 << 9;
61 const int VEHPARS_ARRIVALSPEED_SET = 2 << 10;
62 const int VEHPARS_LINE_SET = 2 << 11;
63 const int VEHPARS_TAZ_SET = 2 << 12;
64 const int VEHPARS_FORCE_REROUTE = 2 << 13;
65 const int VEHPARS_PERSON_CAPACITY_SET = 2 << 14;
66 const int VEHPARS_PERSON_NUMBER_SET = 2 << 15;
67 
68 const int STOP_INDEX_END = -1;
69 const int STOP_INDEX_FIT = -2;
70 
71 
72 // ===========================================================================
73 // enum definitions
74 // ===========================================================================
88 };
89 
90 
110 };
111 
112 
138 };
139 
140 
156 };
157 
158 
172 };
173 
174 
190 };
191 
192 
206 };
207 
208 
209 // ===========================================================================
210 // struct definitions
211 // ===========================================================================
223 public:
229 
230 
235  bool wasSet(int what) const {
236  return (setParameter & what) != 0;
237  }
238 
239 
247  void writeAs(const std::string& xmlElem, OutputDevice& dev,
248  const OptionsCont& oc) const;
249 
250 
256  bool defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const;
257 
258 
259 
262 
272  static bool parseDepartLane(const std::string& val, const std::string& element, const std::string& id,
273  int& lane, DepartLaneDefinition& dld, std::string& error);
274 
275 
285  static bool parseDepartPos(const std::string& val, const std::string& element, const std::string& id,
286  SUMOReal& pos, DepartPosDefinition& dpd, std::string& error);
287 
288 
298  static bool parseDepartSpeed(const std::string& val, const std::string& element, const std::string& id,
299  SUMOReal& speed, DepartSpeedDefinition& dsd, std::string& error);
300 
301 
311  static bool parseArrivalLane(const std::string& val, const std::string& element, const std::string& id,
312  int& lane, ArrivalLaneDefinition& ald, std::string& error);
313 
314 
324  static bool parseArrivalPos(const std::string& val, const std::string& element, const std::string& id,
325  SUMOReal& pos, ArrivalPosDefinition& apd, std::string& error);
326 
327 
337  static bool parseArrivalSpeed(const std::string& val, const std::string& element, const std::string& id,
338  SUMOReal& speed, ArrivalSpeedDefinition& asd, std::string& error);
340 
341 
349  static SUMOReal interpretEdgePos(SUMOReal pos, SUMOReal maximumValue, SumoXMLAttr attr, const std::string& id);
350 
352  std::string id;
353 
355  std::string routeid;
357  std::string vtypeid;
359  mutable RGBColor color;
360 
361 
364 
382 
383 
386 
400 
401 
404 
410 #ifdef HAVE_SUBSECOND_TIMESTEPS
412 #else
414 #endif
415 
416 
417 
419  std::string line;
420 
422  std::string fromTaz;
423 
425  std::string toTaz;
426 
430  struct Stop {
432  std::string lane;
434  std::string busstop;
444  bool triggered;
446  bool parking;
448  int index;
449  };
450 
452  std::vector<Stop> stops;
453 
455  unsigned int personCapacity;
456 
458  unsigned int personNumber;
459 
461  mutable int setParameter;
462 
463 
464 };
465 
466 #endif
467 
468 /****************************************************************************/
469