SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AGTrip.h
Go to the documentation of this file.
1 /****************************************************************************/
11 // Class containing all information of a given trip (car, bus)
12 /****************************************************************************/
13 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
14 // Copyright (C) 2010-2014 DLR (http://www.dlr.de/) and contributors
15 // activitygen module
16 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
17 /****************************************************************************/
18 //
19 // This file is part of SUMO.
20 // SUMO is free software: you can redistribute it and/or modify
21 // it under the terms of the GNU General Public License as published by
22 // the Free Software Foundation, either version 3 of the License, or
23 // (at your option) any later version.
24 //
25 /****************************************************************************/
26 #ifndef AGTRIP_H
27 #define AGTRIP_H
28 
29 
30 // ===========================================================================
31 // included modules
32 // ===========================================================================
33 #ifdef _MSC_VER
34 #include <windows_config.h>
35 #else
36 #include <config.h>
37 #endif
38 
39 #include <list>
40 #include "../city/AGPosition.h"
41 #include "../city/AGCar.h"
42 #include "../city/AGBus.h"
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
48 class AGTrip {
49 public:
50  AGTrip(AGPosition from, AGPosition to, int at) : //vehicle not specified
51  myFrom(from),
52  myTo(to),
53  myDepTime(at),
54  myType("default"),
55  myDay(0) {};
56  AGTrip(AGPosition from, AGPosition to, AGCar c, int at) :
57  myFrom(from),
58  myTo(to),
59  myDepTime(at),
60  myVehicle(c.getName()),
61  myType("default"),
62  myDay(0) {};
63  AGTrip(AGPosition from, AGPosition to, AGBus b, int at) :
64  myFrom(from),
65  myTo(to),
66  myDepTime(at),
67  myVehicle(b.getName()),
68  myType("bus"),
69  myDay(0) {};
70  AGTrip(AGPosition from, AGPosition to, std::string v, int at) :
71  myFrom(from),
72  myTo(to),
73  myDepTime(at),
74  myVehicle(v),
75  myType("default"),
76  myDay(0) {};
77  AGTrip(AGPosition from, AGPosition to, std::string v, int at, int day) :
78  myFrom(from),
79  myTo(to),
80  myDepTime(at),
81  myVehicle(v),
82  myType("default"),
83  myDay(day) {};
84  void print();
85  bool operator<(const AGTrip& trip) const;
86 
87  void addLayOver(AGPosition by);
88  void addLayOver(AGTrip& trip);
90 
91  AGPosition getDep() const;
92  AGPosition getArr() const;
93  int getTime() const;
94  void setDepTime(int time);
95  const std::string& getVehicleName() const;
96  void setVehicleName(std::string name);
97  void setArr(AGPosition arrival);
98  void setDep(AGPosition departure);
99  int getDay() const;
100  void setDay(int day);
101  const std::string& getType() const;
102  void setType(std::string type);
103  std::list<AGPosition>* getPassed();
104 
110  int getRideBackArrTime(SUMOReal secPerKm);
115  int getArrTime(SUMOReal secPerKm);
121  int getTimeTrip(SUMOReal secPerKm);
126  int estimateDepTime(int arrTime, SUMOReal secPerKm);
130  bool isDaily() const;
131 
132 private:
136  std::string myVehicle;
141  std::string myType;
146  int myDay;
147  std::list<AGPosition> myPassBy;
148 };
149 
150 #endif
151 
152 /****************************************************************************/