47 #ifdef CHECK_MEMORY_LEAKS
49 #endif // CHECK_MEMORY_LEAKS
68 const std::string& basePath) {
72 if (type ==
"" || !ok) {
76 KnownActions::iterator i =
myActions.find(type);
81 switch ((*i).second) {
97 const std::string& basePath) {
102 if (dest ==
"" || !ok) {
103 throw InvalidArgument(
"Incomplete description of an 'SaveTLSState'-action occured.");
107 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
114 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
125 const std::string& basePath) {
130 if (dest ==
"" || !ok) {
131 throw InvalidArgument(
"Incomplete description of an 'SaveTLSSwitchTimes'-action occured.");
135 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
142 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
153 const std::string& basePath) {
158 if (dest ==
"" || !ok) {
159 throw InvalidArgument(
"Incomplete description of an 'SaveTLSSwitchStates'-action occured.");
163 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
170 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
Storage for all programs of a single tls.
KnownActions myActions
Build actions that shall be executed during the simulation.
"SaveTLSStates"
Writes the switch times of a tls into a file when the tls switches.
std::vector< std::string > getAllTLIds() const
The simulated network and simulation perfomer.
"SaveTLSSwitchTimes"
Encapsulated SAX-Attributes.
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
void buildSaveTLSwitchesCommand(const SUMOSAXAttributes &attrs, const std::string &basePath)
Builds an action which saves the switch times of links into a file.
"SaveTLSSwitchStates"
void addAction(const SUMOSAXAttributes &attrs, const std::string &basePath)
Builds an action and saves it for further use.
bool knows(const std::string &id) const
Returns the information whether the named tls is stored.
Writes the state of the tls to a file (in each second)
NLDiscreteEventBuilder(MSNet &net)
Constructor.
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
static std::string checkForRelativity(const std::string &filename, const std::string &basePath)
Returns the path from a configuration so that it is accessable from the current working directory...
TLSLogicVariants & get(const std::string &id) const
Returns the variants of a named tls.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
~NLDiscreteEventBuilder()
Destructor.
Writes information about the green durations of a tls.
void buildSaveTLStateCommand(const SUMOSAXAttributes &attrs, const std::string &basePath)
Builds an action which saves the state of a certain tls into a file.
void buildSaveTLSwitchStatesCommand(const SUMOSAXAttributes &attrs, const std::string &basePath)
Builds an action which saves the switch times and states of tls into a file.