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) {
96 if (dest ==
"" || !ok) {
97 throw InvalidArgument(
"Incomplete description of an 'SaveTLSState'-action occurred.");
101 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
104 saveDetectors, saveConditions);
109 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
114 saveDetectors, saveConditions);
121 const std::string& basePath) {
126 if (dest ==
"" || !ok) {
127 throw InvalidArgument(
"Incomplete description of an 'SaveTLSSwitchTimes'-action occurred.");
131 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
138 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
149 const std::string& basePath) {
154 if (dest ==
"" || !ok) {
155 throw InvalidArgument(
"Incomplete description of an 'SaveTLSSwitchStates'-action occurred.");
159 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
166 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
177 const std::string& basePath) {
182 if (dest ==
"" || !ok) {
183 throw InvalidArgument(
"Incomplete description of an 'SaveTLSProgram'-action occurred.");
187 for (std::vector<std::string>::const_iterator tls = ids.begin(); tls != ids.end(); ++tls) {
194 throw InvalidArgument(
"The traffic light logic to save (" + source +
") is not known.");
@ SUMO_ATTR_SAVE_DETECTORS
@ SUMO_ATTR_SAVE_CONDITIONS
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, bool usePrefix=true)
Returns the described OutputDevice.
Encapsulated SAX-Attributes.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue=T(), bool report=true) const
Tries to read given attribute assuming it is an int.