Eclipse SUMO - Simulation of Urban MObility
NLDiscreteEventBuilder Class Reference

#include <NLDiscreteEventBuilder.h>

Collaboration diagram for NLDiscreteEventBuilder:
[legend]

Public Types

enum  ActionType { EV_SAVETLSTATE , EV_SAVETLSWITCHES , EV_SAVETLSWITCHSTATES , EV_SAVETLSPROGRAM }
 Known action types. More...
 

Public Member Functions

void addAction (const SUMOSAXAttributes &attrs, const std::string &basePath)
 Builds an action and saves it for further use. More...
 
 NLDiscreteEventBuilder (MSNet &net)
 Constructor. More...
 
 ~NLDiscreteEventBuilder ()
 Destructor. More...
 

Protected Types

typedef std::map< std::string, ActionTypeKnownActions
 Definitions of a storage for build actions. More...
 

Protected Attributes

KnownActions myActions
 Build actions that shall be executed during the simulation. More...
 
MSNetmyNet
 

Private Member Functions

void buildSaveTLSProgramCommand (const SUMOSAXAttributes &attrs, const std::string &basePath)
 Builds an action which saves the tls states as a loadable program into a file. More...
 
void buildSaveTLStateCommand (const SUMOSAXAttributes &attrs, const std::string &basePath)
 Builds an action which saves the state of a certain tls into a file. More...
 
void buildSaveTLSwitchesCommand (const SUMOSAXAttributes &attrs, const std::string &basePath)
 Builds an action which saves the switch times of links into a file. More...
 
void buildSaveTLSwitchStatesCommand (const SUMOSAXAttributes &attrs, const std::string &basePath)
 Builds an action which saves the switch times and states of tls into a file. More...
 
NLDiscreteEventBuilderoperator= (const NLDiscreteEventBuilder &)
 

Detailed Description

This class is responsible for building event-handling actions which the simulation shall execute.

Definition at line 43 of file NLDiscreteEventBuilder.h.

Member Typedef Documentation

◆ KnownActions

typedef std::map<std::string, ActionType> NLDiscreteEventBuilder::KnownActions
protected

Definitions of a storage for build actions.

Definition at line 84 of file NLDiscreteEventBuilder.h.

Member Enumeration Documentation

◆ ActionType

Known action types.

Enumerator
EV_SAVETLSTATE 

"SaveTLSStates"

EV_SAVETLSWITCHES 

"SaveTLSSwitchTimes"

EV_SAVETLSWITCHSTATES 

"SaveTLSSwitchStates"

EV_SAVETLSPROGRAM 

"SaveTLSProgram"

Definition at line 46 of file NLDiscreteEventBuilder.h.

Constructor & Destructor Documentation

◆ NLDiscreteEventBuilder()

NLDiscreteEventBuilder::NLDiscreteEventBuilder ( MSNet net)

◆ ~NLDiscreteEventBuilder()

NLDiscreteEventBuilder::~NLDiscreteEventBuilder ( )

Destructor.

Definition at line 52 of file NLDiscreteEventBuilder.cpp.

Member Function Documentation

◆ addAction()

void NLDiscreteEventBuilder::addAction ( const SUMOSAXAttributes attrs,
const std::string &  basePath 
)

Builds an action and saves it for further use.

Definition at line 56 of file NLDiscreteEventBuilder.cpp.

References buildSaveTLSProgramCommand(), buildSaveTLStateCommand(), buildSaveTLSwitchesCommand(), buildSaveTLSwitchStatesCommand(), EV_SAVETLSPROGRAM, EV_SAVETLSTATE, EV_SAVETLSWITCHES, EV_SAVETLSWITCHSTATES, SUMOSAXAttributes::getOpt(), myActions, and SUMO_ATTR_TYPE.

Referenced by NLHandler::myStartElement().

Here is the caller graph for this function:

◆ buildSaveTLSProgramCommand()

void NLDiscreteEventBuilder::buildSaveTLSProgramCommand ( const SUMOSAXAttributes attrs,
const std::string &  basePath 
)
private

Builds an action which saves the tls states as a loadable program into a file.

Definition at line 176 of file NLDiscreteEventBuilder.cpp.

References FileHelpers::checkForRelativity(), MSTLLogicControl::get(), MSTLLogicControl::getAllTLIds(), OutputDevice::getDevice(), SUMOSAXAttributes::getOpt(), MSNet::getTLSControl(), MSTLLogicControl::knows(), myNet, SUMO_ATTR_DEST, and SUMO_ATTR_SOURCE.

Referenced by addAction().

Here is the caller graph for this function:

◆ buildSaveTLStateCommand()

void NLDiscreteEventBuilder::buildSaveTLStateCommand ( const SUMOSAXAttributes attrs,
const std::string &  basePath 
)
private

Builds an action which saves the state of a certain tls into a file.

Definition at line 88 of file NLDiscreteEventBuilder.cpp.

References FileHelpers::checkForRelativity(), MSTLLogicControl::get(), MSTLLogicControl::getAllTLIds(), OutputDevice::getDevice(), SUMOSAXAttributes::getOpt(), MSNet::getTLSControl(), MSTLLogicControl::knows(), myNet, SUMO_ATTR_DEST, SUMO_ATTR_SAVE_CONDITIONS, SUMO_ATTR_SAVE_DETECTORS, and SUMO_ATTR_SOURCE.

Referenced by addAction().

Here is the caller graph for this function:

◆ buildSaveTLSwitchesCommand()

void NLDiscreteEventBuilder::buildSaveTLSwitchesCommand ( const SUMOSAXAttributes attrs,
const std::string &  basePath 
)
private

Builds an action which saves the switch times of links into a file.

Definition at line 120 of file NLDiscreteEventBuilder.cpp.

References FileHelpers::checkForRelativity(), MSTLLogicControl::get(), MSTLLogicControl::getAllTLIds(), OutputDevice::getDevice(), SUMOSAXAttributes::getOpt(), MSNet::getTLSControl(), MSTLLogicControl::knows(), myNet, SUMO_ATTR_DEST, and SUMO_ATTR_SOURCE.

Referenced by addAction().

Here is the caller graph for this function:

◆ buildSaveTLSwitchStatesCommand()

void NLDiscreteEventBuilder::buildSaveTLSwitchStatesCommand ( const SUMOSAXAttributes attrs,
const std::string &  basePath 
)
private

Builds an action which saves the switch times and states of tls into a file.

Definition at line 148 of file NLDiscreteEventBuilder.cpp.

References FileHelpers::checkForRelativity(), MSTLLogicControl::get(), MSTLLogicControl::getAllTLIds(), OutputDevice::getDevice(), SUMOSAXAttributes::getOpt(), MSNet::getTLSControl(), MSTLLogicControl::knows(), myNet, SUMO_ATTR_DEST, and SUMO_ATTR_SOURCE.

Referenced by addAction().

Here is the caller graph for this function:

◆ operator=()

NLDiscreteEventBuilder& NLDiscreteEventBuilder::operator= ( const NLDiscreteEventBuilder )
private

Field Documentation

◆ myActions

KnownActions NLDiscreteEventBuilder::myActions
protected

Build actions that shall be executed during the simulation.

Definition at line 87 of file NLDiscreteEventBuilder.h.

Referenced by addAction(), and NLDiscreteEventBuilder().

◆ myNet

MSNet& NLDiscreteEventBuilder::myNet
protected

The documentation for this class was generated from the following files: