00001 /****************************************************************************/ 00007 // A container for traffic light definitions and built programs 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright 2001-2010 DLR (http://www.dlr.de/) and contributors 00011 /****************************************************************************/ 00012 // 00013 // This program is free software; you can redistribute it and/or modify 00014 // it under the terms of the GNU General Public License as published by 00015 // the Free Software Foundation; either version 2 of the License, or 00016 // (at your option) any later version. 00017 // 00018 /****************************************************************************/ 00019 #ifndef NBTrafficLightLogicCont_h 00020 #define NBTrafficLightLogicCont_h 00021 00022 00023 // =========================================================================== 00024 // included modules 00025 // =========================================================================== 00026 #ifdef _MSC_VER 00027 #include <windows_config.h> 00028 #else 00029 #include <config.h> 00030 #endif 00031 00032 #include <map> 00033 #include <string> 00034 #include "NBTrafficLightDefinition.h" 00035 00036 00037 // =========================================================================== 00038 // class declarations 00039 // =========================================================================== 00040 class OptionsCont; 00041 class NBEdgeCont; 00042 class OutputDevice; 00043 00044 00045 // =========================================================================== 00046 // class definitions 00047 // =========================================================================== 00062 class NBTrafficLightLogicCont { 00063 public: 00065 NBTrafficLightLogicCont() throw(); 00066 00068 ~NBTrafficLightLogicCont() throw(); 00069 00070 00079 void applyOptions(OptionsCont &oc) throw(); 00080 00081 00091 bool insert(NBTrafficLightDefinition *logic) throw(); 00092 00093 00102 bool remove(const std::string &id) throw(); 00103 00104 00114 void computeLogics(NBEdgeCont &ec, OptionsCont &oc) throw(); 00115 00116 00125 void writeXML(OutputDevice &into) throw(IOError); 00126 00127 00130 void clear() throw(); 00131 00132 00140 void remapRemoved(NBEdge *removed, 00141 const EdgeVector &incoming, const EdgeVector &outgoing) throw(); 00142 00143 00152 void replaceRemoved(NBEdge *removed, int removedLane, 00153 NBEdge *by, int byLane) throw(); 00154 00155 00161 NBTrafficLightDefinition *getDefinition(const std::string &id) const throw(); 00162 00163 00173 void setTLControllingInformation(const NBEdgeCont &ec) throw(); 00174 00175 00176 private: 00178 typedef std::map<std::string, NBTrafficLightLogic*> ComputedContType; 00179 00181 ComputedContType myComputed; 00182 00184 typedef std::map<std::string, NBTrafficLightDefinition*> DefinitionContType; 00185 00187 DefinitionContType myDefinitions; 00188 00190 std::vector<std::string> myHalfOffsetTLS; 00191 00193 std::vector<std::string> myQuarterOffsetTLS; 00194 00195 00196 }; 00197 00198 00199 #endif 00200 00201 /****************************************************************************/ 00202
1.5.6