12#ifndef _NETWORK_CONFIGURATION_H_
13#define _NETWORK_CONFIGURATION_H_
76 simulatorConfig.SetConfiguration(key, value);
81 simulatorConfig.SetConfiguration(key, value);
86 simulatorConfig.SetConfiguration(key, value);
97 bool IsSet(
const std::string &key)
const
99 return simulatorConfig.IsSet(key);
112 return simulatorConfig.GetConfiguration(key);
117 return simulatorConfig.GetConfigurationAsInt(key);
122 return simulatorConfig.GetConfigurationAsDouble(key);
127 return simulatorConfig.CanBeAppliedOnInitializedSimulator(key);
132 simulatorConfig = config;
137 simulatorConfig.ApplyConfigurationToSimulator(simulator);
142 simulatorConfig.ApplyConfigurationFromSimulator(simulator);
149 ApplyConfigurationFromMap(network->GetConfigMap());
154 for (
const auto &[key, value] : simulatorConfig.GetConfigMap())
155 network->Configure(key.c_str(), value.c_str());
158 const std::unordered_map<std::string, std::string> &
GetConfigMap()
const
160 return simulatorConfig.GetConfigMap();
163 bool WasApplied(
const std::string &key,
const std::string &value)
const
165 return simulatorConfig.WasApplied(key, value);
std::string GetConfiguration(const std::string &key) const
Get a configuration value.
void SetSimulatorConfiguration(const Simulators::Configuration &config)
void ApplyConfigurationFromSimulator(const std::shared_ptr< Simulators::IState > &simulator)
bool IsSet(const std::string &key) const
Check if a configuration value is set.
virtual ~Configuration()=default
The destructor.
void SetConfiguration(const std::string &key, long long int value)
Configuration & operator=(Configuration &&)=default
The move assignment operator.
bool CanBeAppliedOnInitializedSimulator(const std::string &key) const
Configuration(const Configuration &)=default
The copy constructor.
void ApplyConfigurationFromNetwork(const std::shared_ptr< INetwork< Time > > &network)
double GetConfigurationAsDouble(const std::string &key) const
Configuration()=default
The constructor.
long long int GetConfigurationAsInt(const std::string &key) const
void ApplyConfigurationToSimulator(const std::shared_ptr< Simulators::IState > &simulator) const
void ApplyConfigurationToNetwork(const std::shared_ptr< INetwork< Time > > &network) const
bool WasApplied(const std::string &key, const std::string &value) const
Configuration & operator=(const Configuration &)=default
The copy assignment operator.
Configuration(Configuration &&)=default
The move constructor.
const std::unordered_map< std::string, std::string > & GetConfigMap() const
void SetConfiguration(const std::string &key, double value)
void SetConfiguration(const std::string &key, const std::string &value)
Set a configuration value.