57 const std::string& basePath) {
61 if (type ==
"" || !ok) {
65 KnownActions::iterator i =
myActions.find(type);
70 switch ((*i).second) {
89 const std::string& basePath) {
94 if (dest ==
"" || !ok) {
95 throw InvalidArgument(
"Incomplete description of an 'SaveTLSState'-action occurred.");
99 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
106 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
117 const std::string& basePath) {
122 if (dest ==
"" || !ok) {
123 throw InvalidArgument(
"Incomplete description of an 'SaveTLSSwitchTimes'-action occurred.");
127 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
134 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
145 const std::string& basePath) {
150 if (dest ==
"" || !ok) {
151 throw InvalidArgument(
"Incomplete description of an 'SaveTLSSwitchStates'-action occurred.");
155 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
162 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
173 const std::string& basePath) {
178 if (dest ==
"" || !ok) {
179 throw InvalidArgument(
"Incomplete description of an 'SaveTLSProgram'-action occurred.");
183 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
190 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
Writes the switch times of a tls into a file when the tls switches.
Writes the state of the tls to a file (in each second)
Writes the switch times of a tls into a file when the tls switches.
Writes information about the green durations of a tls.
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.
The simulated network and simulation perfomer.
MSTLLogicControl & getTLSControl()
Returns the tls logics control.
Storage for all programs of a single tls.
std::vector< std::string > getAllTLIds() const
bool knows(const std::string &id) const
Returns the information whether the named tls is stored.
TLSLogicVariants & get(const std::string &id) const
Returns the variants of a named tls.
NLDiscreteEventBuilder(MSNet &net)
Constructor.
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.
void buildSaveTLSProgramCommand(const SUMOSAXAttributes &attrs, const std::string &basePath)
Builds an action which saves the tls states as a loadable program into a file.
~NLDiscreteEventBuilder()
Destructor.
KnownActions myActions
Build actions that shall be executed during the simulation.
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.
@ EV_SAVETLSTATE
"SaveTLSStates"
@ EV_SAVETLSWITCHSTATES
"SaveTLSSwitchStates"
@ EV_SAVETLSWITCHES
"SaveTLSSwitchTimes"
@ EV_SAVETLSPROGRAM
"SaveTLSProgram"
static OutputDevice & getDevice(const std::string &name)
Returns the described OutputDevice.
Encapsulated SAX-Attributes.
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.