21 #ifndef NBTrafficLightLogicCont_h 22 #define NBTrafficLightLogicCont_h 116 bool removeProgram(
const std::string
id,
const std::string programID,
bool del =
true);
132 std::vector<NBTrafficLightLogic*>
getComputed()
const;
193 const std::map<std::string, NBTrafficLightDefinition*>&
getPrograms(
const std::string&
id)
const;
221 typedef std::map<std::string, NBTrafficLightDefinition*>
Program2Def;
222 typedef std::map<std::string, Program2Def>
Id2Defs;
223 typedef std::vector<NBTrafficLightLogic*>
Logics;
const std::map< std::string, NBTrafficLightDefinition * > & getPrograms(const std::string &id) const
Returns all programs for the given tl-id.
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::vector< NBTrafficLightDefinition * > Definitions
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.
std::set< std::string > myQuarterOffsetTLS
List of tls which shall have an offset of T/2.
std::map< std::string, NBTrafficLightDefinition * > Program2Def
NBTrafficLightDefinition * getDefinition(const std::string &id, const std::string &programID) const
Returns the named definition.
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.
Storage for edges, including some functionality operating on multiple edges.
std::vector< NBTrafficLightLogic * > Logics
NBTrafficLightLogicCont()
Constructor.
Id2Defs myDefinitions
The container for tl-ids to their definitions.
std::vector< NBTrafficLightLogic * > getComputed() const
Returns a list of all computed logics.
bool computeSingleLogic(OptionsCont &oc, NBTrafficLightDefinition *def)
Computes a specific traffic light logic (using by NETEDIT)
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
int getNumExtracted() const
return the number of extracted traffic light definitions
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.
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
NBTrafficLightLogic * getLogic(const std::string &id, const std::string &programID) const
Returns the computed logic for the given name.
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.
std::pair< int, int > computeLogics(OptionsCont &oc)
Computes the traffic light logics using the stored definitions and stores the results.
Definitions getDefinitions() const
Returns a list of all definitions (convenience for easier iteration)
~NBTrafficLightLogicCont()
Destructor.