SUMO - Simulation of Urban MObility
AGActivityTripWriter.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // Class for writing Trip objects in a SUMO-route file.
00010 /****************************************************************************/
00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00013 // activitygen module
00014 // Copyright 2010 TUM (Technische Universitaet Muenchen, http://www.tum.de/)
00015 /****************************************************************************/
00016 //
00017 //   This file is part of SUMO.
00018 //   SUMO is free software: you can redistribute it and/or modify
00019 //   it under the terms of the GNU General Public License as published by
00020 //   the Free Software Foundation, either version 3 of the License, or
00021 //   (at your option) any later version.
00022 //
00023 /****************************************************************************/
00024 #ifndef AGACTIVITYTRIPWRITER_H
00025 #define AGACTIVITYTRIPWRITER_H
00026 
00027 
00028 // ===========================================================================
00029 // included modules
00030 // ===========================================================================
00031 #ifdef _MSC_VER
00032 #include <windows_config.h>
00033 #else
00034 #include <config.h>
00035 #endif
00036 
00037 #include "activities/AGTrip.h"
00038 #include <iostream>
00039 #include <fstream>
00040 #include <map>
00041 #include <string>
00042 
00043 
00044 // ===========================================================================
00045 // class definitions
00046 // ===========================================================================
00047 class AGActivityTripWriter {
00048 public:
00049     AGActivityTripWriter(std::string file) :
00050         fileName(file),
00051         routes(file.c_str()) {
00052         initialize();
00053     }
00054 
00055     void initialize();
00056     void addTrip(AGTrip trip);
00057     void writeOutputFile();
00058 
00059 private:
00060     std::string fileName;
00061     std::ofstream routes;
00062     std::map<std::string, std::string> colors;
00063 
00064     void vtypes();
00065 };
00066 
00067 
00068 #endif
00069 
00070 /****************************************************************************/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines