1 /****************************************************************************/ 2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo 3 // Copyright (C) 2014-2019 German Aerospace Center (DLR) and others. 4 // This program and the accompanying materials 5 // are made available under the terms of the Eclipse Public License v2.0 6 // which accompanies this distribution, and is available at 7 // http://www.eclipse.org/legal/epl-v20.html 8 // SPDX-License-Identifier: EPL-2.0 9 /****************************************************************************/ 10 /// @file MSAmitranTrajectories.h 11 /// @author Michael Behrisch 12 /// @date 13.03.2014 13 /// @version $Id$ 14 /// 15 // Realises dumping the complete network state 16 /****************************************************************************/ 17 #ifndef MSAmitranTrajectories_h 18 #define MSAmitranTrajectories_h 19 20 21 // =========================================================================== 22 // included modules 23 // =========================================================================== 24 #include <config.h> 25 26 #include <utils/common/SUMOTime.h> 27 28 29 // =========================================================================== 30 // class declarations 31 // =========================================================================== 32 class OutputDevice; 33 class MSVehicleControl; 34 class MSEdge; 35 class MSBaseVehicle; 36 class MSLane; 37 38 39 // =========================================================================== 40 // class definitions 41 // =========================================================================== 42 /** 43 * @class MSAmitranTrajectories 44 * @brief Realises dumping the complete network state 45 * 46 * The class offers a static method, which writes the complete dump of 47 * the given network into the given OutputDevice. 48 * 49 * @todo consider error-handling on write (using IOError) 50 */ 51 class MSAmitranTrajectories { 52 public: 53 /** @brief Writes the complete network state into the given device 54 * 55 * Opens the current time step, goes through the vehicles and writes each using 56 * writeVehicle. 57 * 58 * @param[in] of The output device to use 59 * @param[in] timestep The current time step 60 * @exception IOError If an error on writing occurs (!!! not yet implemented) 61 */ 62 static void write(OutputDevice& of, const SUMOTime timestep); 63 64 65 private: 66 /** @brief Writes the dump of the given vehicle into the given device 67 * 68 * @param[in] of The output device to use 69 * @param[in] veh The vehicle to dump 70 * @param[in] timestep The current time step 71 * @exception IOError If an error on writing occurs (!!! not yet implemented) 72 */ 73 static void writeVehicle(OutputDevice& of, const SUMOVehicle& veh, const SUMOTime timestep); 74 75 76 private: 77 static std::set<std::string> myWrittenTypes; 78 static std::map<std::string, int> myWrittenVehicles; 79 80 81 private: 82 /// @brief Invalidated copy constructor. 83 MSAmitranTrajectories(const MSAmitranTrajectories&); 84 85 /// @brief Invalidated assignment operator. 86 MSAmitranTrajectories& operator=(const MSAmitranTrajectories&); 87 88 89 }; 90 91 92 #endif 93 94 /****************************************************************************/ 95 96