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