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-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"
40 
41 
42 // ===========================================================================
43 // class declarations
44 // ===========================================================================
45 class OutputDevice;
46 class OptionsCont;
47 
48 
49 // ===========================================================================
50 // value definitions
51 // ===========================================================================
52 const int VEHPARS_COLOR_SET = 1;
53 const int VEHPARS_VTYPE_SET = 2;
54 const int VEHPARS_DEPARTLANE_SET = 2 << 1;
55 const int VEHPARS_DEPARTPOS_SET = 2 << 2;
56 const int VEHPARS_DEPARTSPEED_SET = 2 << 3;
57 const int VEHPARS_PERIODNUM_SET = 2 << 4;
58 const int VEHPARS_PERIODFREQ_SET = 2 << 5;
59 const int VEHPARS_ROUTE_SET = 2 << 6;
60 const int VEHPARS_ARRIVALLANE_SET = 2 << 7;
61 const int VEHPARS_ARRIVALPOS_SET = 2 << 8;
62 const int VEHPARS_ARRIVALSPEED_SET = 2 << 9;
63 const int VEHPARS_LINE_SET = 2 << 10;
64 const int VEHPARS_TAZ_SET = 2 << 11;
65 const int VEHPARS_FORCE_REROUTE = 2 << 12;
66 const int VEHPARS_PERSON_CAPACITY_SET = 2 << 13;
67 const int VEHPARS_PERSON_NUMBER_SET = 2 << 14;
68 
69 const int STOP_INDEX_END = -1;
70 const int STOP_INDEX_FIT = -2;
71 
72 const int STOP_END_SET = 1;
73 const int STOP_START_SET = 2;
74 const int STOP_TRIGGER_SET = 2 << 1;
75 const int STOP_PARKING_SET = 2 << 2;
76 
77 
78 // ===========================================================================
79 // enum definitions
80 // ===========================================================================
94 };
95 
96 
116 };
117 
118 
144 };
145 
146 
162 };
163 
164 
178 };
179 
180 
196 };
197 
198 
212 };
213 
214 
215 // ===========================================================================
216 // struct definitions
217 // ===========================================================================
229 public:
235 
236 
241  bool wasSet(int what) const {
242  return (setParameter & what) != 0;
243  }
244 
245 
252  void write(OutputDevice& dev, const OptionsCont& oc) const;
253 
254 
260  void writeStops(OutputDevice& dev) const;
261 
262 
268  bool defaultOptionOverrides(const OptionsCont& oc, const std::string& optionName) const;
269 
270 
271 
274 
284  static bool parseDepartLane(const std::string& val, const std::string& element, const std::string& id,
285  int& lane, DepartLaneDefinition& dld, std::string& error);
286 
287 
297  static bool parseDepartPos(const std::string& val, const std::string& element, const std::string& id,
298  SUMOReal& pos, DepartPosDefinition& dpd, std::string& error);
299 
300 
310  static bool parseDepartSpeed(const std::string& val, const std::string& element, const std::string& id,
311  SUMOReal& speed, DepartSpeedDefinition& dsd, std::string& error);
312 
313 
323  static bool parseArrivalLane(const std::string& val, const std::string& element, const std::string& id,
324  int& lane, ArrivalLaneDefinition& ald, std::string& error);
325 
326 
336  static bool parseArrivalPos(const std::string& val, const std::string& element, const std::string& id,
337  SUMOReal& pos, ArrivalPosDefinition& apd, std::string& error);
338 
339 
349  static bool parseArrivalSpeed(const std::string& val, const std::string& element, const std::string& id,
350  SUMOReal& speed, ArrivalSpeedDefinition& asd, std::string& error);
352 
353 
361  static SUMOReal interpretEdgePos(SUMOReal pos, SUMOReal maximumValue, SumoXMLAttr attr, const std::string& id);
362 
364  std::string id;
365 
367  std::string routeid;
369  std::string vtypeid;
371  mutable RGBColor color;
372 
373 
376 
394 
395 
398 
412 
413 
416 
422 #ifdef HAVE_SUBSECOND_TIMESTEPS
424 #else
426 #endif
427 
428 
429 
431  std::string line;
432 
434  std::string fromTaz;
435 
437  std::string toTaz;
438 
442  struct Stop {
444  std::string lane;
446  std::string busstop;
456  bool triggered;
458  bool parking;
460  int index;
463  };
464 
466  std::vector<Stop> stops;
467 
469  unsigned int personCapacity;
470 
472  unsigned int personNumber;
473 
475  mutable int setParameter;
476 
477 
478 };
479 
480 #endif
481 
482 /****************************************************************************/
483