SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AGActivityTripWriter.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Class for writing Trip objects in a SUMO-route file.
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 AGACTIVITYTRIPWRITER_H
25 #define AGACTIVITYTRIPWRITER_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 "activities/AGTrip.h"
38 #include <iostream>
39 #include <fstream>
40 #include <map>
41 #include <string>
42 
43 
44 // ===========================================================================
45 // class definitions
46 // ===========================================================================
48 public:
49  AGActivityTripWriter(std::string file) :
50  fileName(file),
51  routes(file.c_str()) {
52  initialize();
53  }
54 
55  void initialize();
56  void addTrip(AGTrip trip);
57  void writeOutputFile();
58 
59 private:
60  std::string fileName;
61  std::ofstream routes;
62  std::map<std::string, std::string> colors;
63 
64  void vtypes();
65 };
66 
67 
68 #endif
69 
70 /****************************************************************************/