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-sim.org/
13 // Copyright (C) 2001-2013 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"
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class OutputDevice;
47 class OptionsCont;
48 
49 
50 // ===========================================================================
51 // value definitions
52 // ===========================================================================
53 const int VEHPARS_COLOR_SET = 1;
54 const int VEHPARS_VTYPE_SET = 2;
55 const int VEHPARS_DEPARTLANE_SET = 2 << 1;
56 const int VEHPARS_DEPARTPOS_SET = 2 << 2;
57 const int VEHPARS_DEPARTSPEED_SET = 2 << 3;
58 const int VEHPARS_PERIODNUM_SET = 2 << 4;
59 const int VEHPARS_PERIODFREQ_SET = 2 << 5;
60 const int VEHPARS_ROUTE_SET = 2 << 6;
61 const int VEHPARS_ARRIVALLANE_SET = 2 << 7;
62 const int VEHPARS_ARRIVALPOS_SET = 2 << 8;
63 const int VEHPARS_ARRIVALSPEED_SET = 2 << 9;
64 const int VEHPARS_LINE_SET = 2 << 10;
65 const int VEHPARS_TAZ_SET = 2 << 11;
66 const int VEHPARS_FORCE_REROUTE = 2 << 12;
67 const int VEHPARS_PERSON_CAPACITY_SET = 2 << 13;
68 const int VEHPARS_PERSON_NUMBER_SET = 2 << 14;
69 
70 const int STOP_INDEX_END = -1;
71 const int STOP_INDEX_FIT = -2;
72 
73 const int STOP_END_SET = 1;
74 const int STOP_START_SET = 2;
75 const int STOP_TRIGGER_SET = 2 << 1;
76 const int STOP_PARKING_SET = 2 << 2;
77 const int STOP_EXPECTED_SET = 2 << 3;
78 
79 
80 // ===========================================================================
81 // enum definitions
82 // ===========================================================================
96 };
97 
98 
118 };
119 
120 
146 };
147 
148 
164 };
165 
166 
180 };
181 
182 
198 };
199 
200 
214 };
215 
216 
217 // ===========================================================================
218 // struct definitions
219 // ===========================================================================
231 public:
237 
238 
243  bool wasSet(int what) const {
244  return (setParameter & what) != 0;
245  }
246 
247 
254  void write(OutputDevice& dev, const OptionsCont& oc) const;
255 
256 
262  void writeStops(OutputDevice& dev) const;
263 
264 
270  bool defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const;
271 
272 
273 
276 
286  static bool parseDepartLane(const std::string& val, const std::string& element, const std::string& id,
287  int& lane, DepartLaneDefinition& dld, std::string& error);
288 
289 
299  static bool parseDepartPos(const std::string& val, const std::string& element, const std::string& id,
300  SUMOReal& pos, DepartPosDefinition& dpd, std::string& error);
301 
302 
312  static bool parseDepartSpeed(const std::string& val, const std::string& element, const std::string& id,
313  SUMOReal& speed, DepartSpeedDefinition& dsd, std::string& error);
314 
315 
325  static bool parseArrivalLane(const std::string& val, const std::string& element, const std::string& id,
326  int& lane, ArrivalLaneDefinition& ald, std::string& error);
327 
328 
338  static bool parseArrivalPos(const std::string& val, const std::string& element, const std::string& id,
339  SUMOReal& pos, ArrivalPosDefinition& apd, std::string& error);
340 
341 
351  static bool parseArrivalSpeed(const std::string& val, const std::string& element, const std::string& id,
352  SUMOReal& speed, ArrivalSpeedDefinition& asd, std::string& error);
354 
355 
363  static SUMOReal interpretEdgePos(SUMOReal pos, SUMOReal maximumValue, SumoXMLAttr attr, const std::string& id);
364 
366  std::string id;
367 
369  std::string routeid;
371  std::string vtypeid;
373  mutable RGBColor color;
374 
375 
378 
396 
397 
400 
414 
415 
418 
424 #ifdef HAVE_SUBSECOND_TIMESTEPS
426 #else
428 #endif
429 
431 
433  std::string line;
434 
436  std::string fromTaz;
437 
439  std::string toTaz;
440 
444  struct Stop {
446  std::string lane;
448  std::string busstop;
458  bool triggered;
460  bool parking;
462  std::set<std::string> awaitedPersons;
464  int index;
467  };
468 
470  std::vector<Stop> stops;
471 
473  unsigned int personCapacity;
474 
476  unsigned int personNumber;
477 
479  mutable int setParameter;
480 
481 
482 };
483 
484 #endif
485 
486 /****************************************************************************/
487