63 const std::string& basePath) {
67 if (type ==
"" || !ok) {
71 KnownActions::iterator i =
myActions.find(type);
76 switch ((*i).second) {
92 const std::string& basePath) {
97 if (dest ==
"" || !ok) {
98 throw InvalidArgument(
"Incomplete description of an 'SaveTLSState'-action occured.");
102 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
109 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
120 const std::string& basePath) {
125 if (dest ==
"" || !ok) {
126 throw InvalidArgument(
"Incomplete description of an 'SaveTLSSwitchTimes'-action occured.");
130 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
137 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
148 const std::string& basePath) {
153 if (dest ==
"" || !ok) {
154 throw InvalidArgument(
"Incomplete description of an 'SaveTLSSwitchStates'-action occured.");
158 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
165 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.