41 const std::string & sPrefix):
57 "Defines the shape factor to use for distance" 58 " < fading.nakagami.distance0.",
61 configRegistrar.registerNumeric<
double>(sPrefix_ +
"nakagami.m1",
65 "Defines the shape factor to use for distance" 66 " >= fading.nakagami.distance0 and <" 67 " fading.nakagami.distance1.",
70 configRegistrar.registerNumeric<
double>(sPrefix_ +
"nakagami.m2",
74 "Defines the shape factor to use for distance" 75 " >= fading.nakagami.distance1.",
78 configRegistrar.registerNumeric<
double>(sPrefix_ +
"nakagami.distance0",
82 "Defines the distance in meters used for" 83 " lower bound shape selection.");
85 configRegistrar.registerNumeric<
double>(sPrefix_ +
"nakagami.distance1",
89 "Defines the distance in meters used for" 90 " upper bound shape selection.");
94 std::map<std::string,std::vector<Any>> parameters;
96 std::transform(update.begin(),
98 std::inserter(parameters,parameters.end()),
99 [](
const ConfigurationUpdate::value_type & p)
101 return std::make_pair(p.first,p.second);
104 if(parameters[sPrefix_ +
"nakagami.distance0"][0].asDouble() >=
105 parameters[sPrefix_ +
"nakagami.distance1"][0].asDouble())
107 return std::make_pair(
"nakagami.distance0 < nakagami.distance1",
false);
110 return std::make_pair(
"",
true);
126 for(
const auto & item : update)
128 if(item.first ==
sPrefix_ +
"nakagami.m0")
130 dm0_ = item.second[0].asDouble();
134 "PHYI %03hu FrameworkPHY::NakagamiFadingAlgorithm::%s: %s = %lf",
140 else if(item.first ==
sPrefix_ +
"nakagami.m1")
142 dm1_ = item.second[0].asDouble();
146 "PHYI %03hu FrameworkPHY::NakagamiFadingAlgorithm::%s: %s = %lf",
152 else if(item.first ==
sPrefix_ +
"nakagami.m2")
154 dm2_ = item.second[0].asDouble();
158 "PHYI %03hu FrameworkPHY::NakagamiFadingAlgorithm::%s: %s = %lf",
164 else if(item.first ==
sPrefix_ +
"nakagami.distance0")
166 dDistance0Meters_ = item.second[0].asDouble();
170 "PHYI %03hu FrameworkPHY::NakagamiFadingAlgorithm::%s: %s = %lf",
176 else if(item.first ==
sPrefix_ +
"nakagami.distance1")
178 dDistance1Meters_ = item.second[0].asDouble();
182 "PHYI %03hu FrameworkPHY::NakagamiFadingAlgorithm::%s: %s = %lf",
The Registrar interface provides access to all of the emulator registrars.
virtual ConfigurationRegistrar & configurationRegistrar()=0
void modify(const ConfigurationUpdate &update) override
void configure(const ConfigurationUpdate &update)
const std::string sPrefix_
NakagamiFadingAlgorithm(NEMId id, PlatformServiceProvider *pPlatformService, const std::string &sPrefix)
std::vector< ConfigurationNameAnyValues > ConfigurationUpdate
void registerNumeric(const std::string &sName, const ConfigurationProperties &properties=ConfigurationProperties::NONE, const std::initializer_list< T > &values={}, const std::string &sUsage="", T minValue=std::numeric_limits< T >::lowest(), T maxValue=std::numeric_limits< T >::max(), std::size_t minOccurs=1, std::size_t maxOccurs=1, const std::string &sRegexPattern={})
void initialize(Registrar ®istrar) override
#define LOGGER_STANDARD_LOGGING(logger, level, fmt, args...)
PlatformServiceProvider *const pPlatformService_