57 const std::string& basePath) {
61 if (type ==
"" || !ok) {
65 KnownActions::iterator i =
myActions.find(type);
70 switch ((*i).second) {
86 const std::string& basePath) {
91 if (dest ==
"" || !ok) {
92 throw InvalidArgument(
"Incomplete description of an 'SaveTLSState'-action occurred.");
96 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
103 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
114 const std::string& basePath) {
119 if (dest ==
"" || !ok) {
120 throw InvalidArgument(
"Incomplete description of an 'SaveTLSSwitchTimes'-action occurred.");
124 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
131 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
142 const std::string& basePath) {
147 if (dest ==
"" || !ok) {
148 throw InvalidArgument(
"Incomplete description of an 'SaveTLSSwitchStates'-action occurred.");
152 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
159 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.
Writes the switch times of a tls into a file when the tls switches.
The simulated network and simulation perfomer.
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.
void addAction(const SUMOSAXAttributes &attrs, const std::string &basePath)
Builds an action and saves it for further use.
Writes the state of the tls to a file (in each second)
bool knows(const std::string &id) const
Returns the information whether the named tls is stored.
NLDiscreteEventBuilder(MSNet &net)
Constructor.
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.
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.
~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.
std::vector< std::string > getAllTLIds() const
void buildSaveTLSwitchStatesCommand(const SUMOSAXAttributes &attrs, const std::string &basePath)
Builds an action which saves the switch times and states of tls into a file.