SUMO - Simulation of Urban MObility

AGActivityTripWriter.h

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