22 #ifndef NBTrafficLightLogicCont_h 23 #define NBTrafficLightLogicCont_h 117 bool removeProgram(
const std::string
id,
const std::string programID,
bool del =
true);
133 std::vector<NBTrafficLightLogic*>
getComputed()
const;
194 const std::map<std::string, NBTrafficLightDefinition*>&
getPrograms(
const std::string&
id)
const;
222 typedef std::map<std::string, NBTrafficLightDefinition*>
Program2Def;
223 typedef std::map<std::string, Program2Def>
Id2Defs;
224 typedef std::vector<NBTrafficLightLogic*>
Logics;
std::map< std::string, NBTrafficLightLogic * > Program2Logic
Definition of internal the container types.
bool removeProgram(const std::string id, const std::string programID, bool del=true)
Removes a program of a logic definition from the dictionary.
static const Program2Def EmptyDefinitions
A container for traffic light definitions and built programs.
A SUMO-compliant built logic for a traffic light.
The representation of a single edge during network building.
The base class for traffic light logic definitions.
std::pair< unsigned int, unsigned int > computeLogics(OptionsCont &oc)
Computes the traffic light logics using the stored definitions and stores the results.
std::vector< NBTrafficLightDefinition * > Definitions
Definitions getDefinitions() const
Returns a list of all definitions (convenience for easier iteration)
void extract(NBTrafficLightDefinition *definition)
Extracts a traffic light definition from myDefinitions but keeps it in myExtracted for eventual * del...
std::set< NBTrafficLightDefinition * > myExtracted
The container for extracted definitions.
NBTrafficLightDefinition * getDefinition(const std::string &id, const std::string &programID) const
Returns the named definition.
std::set< std::string > myQuarterOffsetTLS
List of tls which shall have an offset of T/2.
std::map< std::string, NBTrafficLightDefinition * > Program2Def
void remapRemoved(NBEdge *removed, const EdgeVector &incoming, const EdgeVector &outgoing)
Replaces occurences of the removed edge in incoming/outgoing edges of all definitions.
void applyOptions(OptionsCont &oc)
Initialises the storage by applying given options.
std::set< std::string > myHalfOffsetTLS
List of tls which shall have an offset of T/2.
const std::map< std::string, NBTrafficLightDefinition * > & getPrograms(const std::string &id) const
Returns all programs for the given tl-id.
Storage for edges, including some functionality operating on multiple edges.
std::vector< NBTrafficLightLogic * > getComputed() const
Returns a list of all computed logics.
std::vector< NBTrafficLightLogic * > Logics
NBTrafficLightLogicCont()
Constructor.
Id2Defs myDefinitions
The container for tl-ids to their definitions.
NBTrafficLightLogic * getLogic(const std::string &id, const std::string &programID) const
Returns the computed logic for the given name.
bool computeSingleLogic(OptionsCont &oc, NBTrafficLightDefinition *def)
Computes a specific traffic light logic (using by NETEDIT)
std::vector< NBEdge * > EdgeVector
A storage for options typed value containers)
std::map< std::string, Program2Def > Id2Defs
bool removeFully(const std::string id)
Removes a logic definition (and all programs) from the dictionary.
bool insert(NBTrafficLightDefinition *logic, bool forceInsert=false)
Adds a logic definition to the dictionary.
Static storage of an output device and its base (abstract) implementation.
void clear()
Destroys all stored definitions and logics.
Container for nodes during the netbuilding process.
size_t getNumExtracted() const
return the number of extracted traffic light definitions
void replaceRemoved(NBEdge *removed, int removedLane, NBEdge *by, int byLane)
Replaces occurences of the removed edge/lane in all definitions by the given edge.
std::map< std::string, Program2Logic > Id2Logics
void setTLControllingInformation(const NBEdgeCont &ec, const NBNodeCont &nc)
Informs the edges about being controlled by a tls.
Id2Logics myComputed
The container for previously computed tl-logics.
~NBTrafficLightLogicCont()
Destructor.