INET Framework for OMNeT++/OMNEST
|
Defines an argument for a mapping. More...
#include <MappingBase.h>
Classes | |
class | key_iterator |
Public Types | |
typedef DimensionSet::value_type | key_type |
typedef double | mapped_type |
typedef mapped_type | mapped_type_cref |
typedef container_type::iterator | iterator |
Iterator type for this set. More... | |
typedef container_type::const_iterator | const_iterator |
Const-iterator type for this set. More... | |
Public Member Functions | |
Argument (simtime_t_cref timeVal=SIMTIME_ZERO) | |
Initialize this argument with the passed value for the time dimension. More... | |
Argument (const DimensionSet &dims, simtime_t_cref timeVal=SIMTIME_ZERO) | |
Initializes the Argument with the dimensions of the passed DimensionSet set to zero, and the passed value for the time (or zero, if omitted). More... | |
simtime_t_cref | getTime () const |
Returns the time value of this argument. More... | |
void | setTime (simtime_t_cref time) |
Changes the time value of this argument. More... | |
bool | hasArgVal (const Argument::key_type &dim) const |
Returns true if this Argument has a value for the passed Dimension. More... | |
mapped_type_cref | getArgValue (const Argument::key_type &dim) const |
Returns the value for the specified dimension. More... | |
void | setArgValue (const Argument::key_type &dim, Argument::mapped_type_cref value) |
Changes the value for the specified dimension. More... | |
void | setArgValues (const Argument &o, bool ignoreUnknown=false) |
Update the values of this Argument with the values of the passed Argument. More... | |
bool | isSamePosition (const Argument &other) const |
Returns true if the passed Argument points to the same position. More... | |
bool | operator== (const Argument &o) const |
Two Arguments are compared equal if they have the same dimensions and the same values. More... | |
bool | isClose (const Argument &o, Argument::mapped_type_cref epsilon=Argument::mapped_type(0.000001)) const |
Two Arguments are compared close if they have the same dimensions and their values don't differ more then a specific epsilon. More... | |
bool | operator< (const Argument &o) const |
Returns true if this Argument is smaller then the passed Argument. More... | |
int | compare (const Argument &o, const DimensionSet *const dims=nullptr) const |
Compares this Argument with the passed Argument in the dimensions of the passed DimensionsSet. More... | |
DimensionSet | getDimensions () const |
Returns the dimensions this argument is defined over. More... | |
Argument & | operator= (const Argument &o) |
Fast implementation of the copy-operator then the default implementation. More... | |
iterator | begin () |
Returns an iterator to the first argument value in this Argument. More... | |
const_iterator | begin () const |
Returns an iterator to the first argument value in this Argument. More... | |
iterator | end () |
Returns an iterator to the value behind the last argument value. More... | |
const_iterator | end () const |
Returns an iterator to the value behind the last argument value. More... | |
iterator | find (const Argument::key_type &dim) |
Returns an iterator to the Argument value for the passed Dimension. More... | |
const_iterator | find (const Argument::key_type &dim) const |
Returns an iterator to the Argument value for the passed Dimension. More... | |
iterator | lower_bound (const Argument::key_type &dim) |
Returns an iterator to the first Argument value which dimension compares greater or equal to the passed Dimension. More... | |
const_iterator | lower_bound (const Argument::key_type &dim) const |
Returns an iterator to the first Argument value which dimension compares greater or equal to the passed Dimension. More... | |
Static Public Attributes | |
static const mapped_type | MappedZero = Argument::mapped_type(0) |
Zero value of a Argument value. More... | |
static const mapped_type | MappedOne = Argument::mapped_type(1) |
One value of a Argument value. More... | |
Protected Types | |
typedef std::map< key_type, mapped_type > | container_type |
typedef container_type::value_type | value_type |
Protected Member Functions | |
iterator | insertValue (iterator pos, const Argument::value_type &valPair, iterator &itEnd, bool ignoreUnknown=false) |
Inserts the passed value for the passed Dimension into this Argument. More... | |
Protected Attributes | |
simtime_t | time |
Stores the time dimension in Omnet's time type. More... | |
container_type | values |
Maps the dimensions of this Argument to their values. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &out, const Argument &d) |
Output operator for Arguments. More... | |
Defines an argument for a mapping.
Defines values for a specified set of dimensions, but at least for the time dimension.
Note: Currently an Argument can be maximal defined over ten Dimensions plus the time dimension!
typedef container_type::const_iterator inet::physicallayer::Argument::const_iterator |
Const-iterator type for this set.
|
protected |
typedef container_type::iterator inet::physicallayer::Argument::iterator |
Iterator type for this set.
typedef double inet::physicallayer::Argument::mapped_type |
|
protected |
inet::physicallayer::Argument::Argument | ( | simtime_t_cref | timeVal = SIMTIME_ZERO | ) |
Initialize this argument with the passed value for the time dimension.
inet::physicallayer::Argument::Argument | ( | const DimensionSet & | dims, |
simtime_t_cref | timeVal = SIMTIME_ZERO |
||
) |
Initializes the Argument with the dimensions of the passed DimensionSet set to zero, and the passed value for the time (or zero, if omitted).
|
inline |
Returns an iterator to the first argument value in this Argument.
Referenced by inet::physicallayer::MappingUtils::findMax(), inet::physicallayer::MappingUtils::findMin(), isClose(), isSamePosition(), inet::physicallayer::ConstMapping::print(), and setArgValues().
|
inline |
Returns an iterator to the first argument value in this Argument.
int inet::physicallayer::Argument::compare | ( | const Argument & | o, |
const DimensionSet *const | dims = nullptr |
||
) | const |
Compares this Argument with the passed Argument in the dimensions of the passed DimensionsSet.
(Every other Dimension is asserted equal).
See "operator<" for definition of smaller, equal and bigger.
Referenced by inet::physicallayer::MappingUtils::findMin(), operator<(), and operator==().
|
inline |
Returns an iterator to the value behind the last argument value.
Referenced by inet::physicallayer::MappingUtils::findMax(), inet::physicallayer::MappingUtils::findMin(), isClose(), isSamePosition(), inet::physicallayer::ConstMapping::print(), and setArgValues().
|
inline |
Returns an iterator to the value behind the last argument value.
Argument::iterator inet::physicallayer::Argument::find | ( | const Argument::key_type & | dim | ) |
Returns an iterator to the Argument value for the passed Dimension.
Returns end() if there is no Argument for that dimension.
Referenced by getArgValue(), and inet::physicallayer::ConstMapping::print().
Argument::const_iterator inet::physicallayer::Argument::find | ( | const Argument::key_type & | dim | ) | const |
Returns an iterator to the Argument value for the passed Dimension.
Returns end() if there is no Argument for that dimension.
Argument::mapped_type_cref inet::physicallayer::Argument::getArgValue | ( | const Argument::key_type & | dim | ) | const |
Returns the value for the specified dimension.
Note: Don't use this function to get the time value! Use "getTime()" instead.
Returns zero if no value with the specified dimension is set for this argument.
Referenced by inet::physicallayer::FilledUpMapping::appendValue(), inet::physicallayer::DimensionalAnalogModelBase::computeReceptionPower(), inet::physicallayer::MappingUtils::createCompatibleMapping(), inet::physicallayer::FrequencyMapping< Interpolator >::createIterator(), inet::physicallayer::SimpleConstMapping::createKeyEntries(), inet::physicallayer::MappingUtils::findMax(), inet::physicallayer::MappingUtils::findMin(), inet::physicallayer::FrequencyMapping< Interpolator >::getValue(), inet::physicallayer::MultiDimMapping< Linear >::getValue(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::iterateTo(), inet::physicallayer::MultiDimMappingIterator< Linear >::iterateTo(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::jumpTo(), inet::physicallayer::MultiDimMappingIterator< Linear >::jumpTo(), inet::physicallayer::MultiDimMappingIterator< Linear >::MultiDimMappingIterator(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::next(), inet::physicallayer::ConstMapping::print(), inet::physicallayer::FrequencyMapping< Interpolator >::setValue(), and inet::physicallayer::MultiDimMapping< Linear >::setValue().
|
inline |
Returns the dimensions this argument is defined over.
Note: this method has linear complexity over the number of dimensions, since the DimensionSet has to be created from the values and their dimensions inside this Argument.
Referenced by inet::physicallayer::MappingUtils::findMax(), inet::physicallayer::MappingUtils::findMin(), operator<(), and inet::physicallayer::SimpleConstMappingIterator::SimpleConstMappingIterator().
simtime_t_cref inet::physicallayer::Argument::getTime | ( | ) | const |
Returns the time value of this argument.
Referenced by inet::physicallayer::MappingUtils::addDiscontinuity(), inet::physicallayer::DimensionalAnalogModelBase::computeReceptionPower(), inet::physicallayer::TimeMapping< Interpolator >::createIterator(), inet::physicallayer::SimpleConstMapping::createKeyEntries(), inet::physicallayer::BaseDelayedIterator< Base, Iterator >::delayPosition(), inet::physicallayer::BaseDelayedMapping< Mapping >::delayPosition(), inet::physicallayer::MappingUtils::findMax(), inet::physicallayer::MappingUtils::findMin(), inet::physicallayer::Ieee802154UWBIRTransmitter::generatePulse(), inet::physicallayer::TimeMapping< Interpolator >::getValue(), inet::physicallayer::TimeMappingIterator< Interpolator >::iterateTo(), inet::physicallayer::TimeMappingIterator< Interpolator >::jumpTo(), inet::physicallayer::TimeMappingIterator< Interpolator >::next(), inet::physicallayer::ConstMapping::print(), inet::physicallayer::TimeMapping< Interpolator >::setValue(), and inet::physicallayer::BaseDelayedIterator< Base, Iterator >::undelayPosition().
bool inet::physicallayer::Argument::hasArgVal | ( | const Argument::key_type & | dim | ) | const |
Returns true if this Argument has a value for the passed Dimension.
Referenced by inet::physicallayer::MultiDimMapping< Linear >::getValue(), inet::physicallayer::MultiDimMappingIterator< Linear >::iterateTo(), and inet::physicallayer::MultiDimMappingIterator< Linear >::jumpTo().
|
inlineprotected |
Inserts the passed value for the passed Dimension into this Argument.
The parameter "pos" defines the position inside the Dimension<->Value-pair array to start searching for the dimension to set.
If the "ignoreUnknown"-parameter is set to true the new value is only set if the Dimension was defined in this Argument before (means, no new DImensions are added to the Argument).
The method returns the position inside the array the value was inserted.
Referenced by setArgValues().
bool inet::physicallayer::Argument::isClose | ( | const Argument & | o, |
Argument::mapped_type_cref | epsilon = Argument::mapped_type(0.000001) |
||
) | const |
Two Arguments are compared close if they have the same dimensions and their values don't differ more then a specific epsilon.
bool inet::physicallayer::Argument::isSamePosition | ( | const Argument & | other | ) | const |
Returns true if the passed Argument points to the same position.
The functions returns true if every Dimension in the passed Argument exists in this Argument and their values are the same. The difference to the == operator is that the dimensions of the passed Argument can be a subset of the dimensions of this Argument.
Argument::iterator inet::physicallayer::Argument::lower_bound | ( | const Argument::key_type & | dim | ) |
Returns an iterator to the first Argument value which dimension compares greater or equal to the passed Dimension.
Argument::const_iterator inet::physicallayer::Argument::lower_bound | ( | const Argument::key_type & | dim | ) | const |
Returns an iterator to the first Argument value which dimension compares greater or equal to the passed Dimension.
bool inet::physicallayer::Argument::operator< | ( | const Argument & | o | ) | const |
Returns true if this Argument is smaller then the passed Argument.
The dimensions of the Arguments have to be the same.
An Argument is compared smaller than another Argument if the value of the Dimension with the highest id is compared smaller. If the value of the highest Dimension is compared bigger the Argument isn't compared smaller (method returns false). If the values of the Dimension with the highest Dimension are equal, the next smaller Dimension is compared.
Fast implementation of the copy-operator then the default implementation.
bool inet::physicallayer::Argument::operator== | ( | const Argument & | o | ) | const |
Two Arguments are compared equal if they have the same dimensions and the same values.
void inet::physicallayer::Argument::setArgValue | ( | const Argument::key_type & | dim, |
Argument::mapped_type_cref | value | ||
) |
Changes the value for the specified dimension.
Note: Don't use this function to change the time value! Use "setTime()" instead.
If the argument doesn't already contain a value for the specified dimension the new dimension is added.
Referenced by inet::physicallayer::DimensionalNoise::computeMaxPower(), inet::physicallayer::DimensionalSNIR::computeMin(), inet::physicallayer::DimensionalReception::computeMinPower(), inet::physicallayer::DimensionalSignalAnalogModel::computeMinPower(), inet::physicallayer::IsotropicDimensionalBackgroundNoise::computeNoise(), inet::physicallayer::SimpleConstMapping::createKeyEntries(), inet::physicallayer::DimensionalTransmitterBase::createPowerMapping(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::FrequencyMappingIterator(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::iterateTo(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::jumpTo(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::jumpToBegin(), inet::physicallayer::MultiDimMappingIterator< Linear >::jumpToBegin(), inet::physicallayer::MultiDimMappingIterator< Linear >::MultiDimMappingIterator(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::next(), inet::physicallayer::MultiDimMappingIterator< Linear >::next(), inet::physicallayer::ConstMapping::print(), inet::physicallayer::FrequencyMappingIterator< Interpolator >::updateNextPos(), and inet::physicallayer::MultiDimMappingIterator< Linear >::updateNextPosition().
void inet::physicallayer::Argument::setArgValues | ( | const Argument & | o, |
bool | ignoreUnknown = false |
||
) |
Update the values of this Argument with the values of the passed Argument.
Only the dimensions from the passed Argument are updated or added.
If the ignoreUnknown parameter is set to true, only the Dimensions already inside the Argument are updated.
Referenced by inet::physicallayer::MultiDimMappingIterator< Linear >::iterateTo(), inet::physicallayer::MultiDimMappingIterator< Linear >::jumpTo(), inet::physicallayer::MultiDimMappingIterator< Linear >::jumpToBegin(), inet::physicallayer::MultiDimMappingIterator< Linear >::next(), and inet::physicallayer::MultiDimMappingIterator< Linear >::updateNextPosition().
void inet::physicallayer::Argument::setTime | ( | simtime_t_cref | time | ) |
Changes the time value of this argument.
Referenced by inet::physicallayer::MappingUtils::addDiscontinuity(), inet::physicallayer::DimensionalNoise::computeMaxPower(), inet::physicallayer::DimensionalSNIR::computeMin(), inet::physicallayer::DimensionalReception::computeMinPower(), inet::physicallayer::DimensionalSignalAnalogModel::computeMinPower(), inet::physicallayer::IsotropicDimensionalBackgroundNoise::computeNoise(), inet::physicallayer::DimensionalAnalogModelBase::computeReceptionPower(), inet::physicallayer::SimpleConstMapping::createKeyEntries(), inet::physicallayer::DimensionalTransmitterBase::createPowerMapping(), inet::physicallayer::BaseDelayedIterator< Base, Iterator >::delayPosition(), inet::physicallayer::BaseDelayedMapping< Mapping >::delayPosition(), inet::physicallayer::Ieee802154UWBIRTransmitter::generateBurst(), inet::physicallayer::Ieee802154UWBIRTransmitter::generatePulse(), inet::physicallayer::Ieee802154UWBIRTransmitter::generateSFD(), inet::physicallayer::Ieee802154UWBIRTransmitter::generateSyncPreamble(), inet::physicallayer::Ieee802154UWBIRReceiver::integrateWindow(), inet::physicallayer::TimeMappingIterator< Interpolator >::iterateTo(), inet::physicallayer::TimeMappingIterator< Interpolator >::jumpTo(), inet::physicallayer::TimeMappingIterator< Interpolator >::jumpToBegin(), inet::physicallayer::TimeMappingIterator< Interpolator >::next(), inet::physicallayer::ConstMapping::print(), inet::physicallayer::TimeMappingIterator< Interpolator >::TimeMappingIterator(), inet::physicallayer::BaseDelayedIterator< Base, Iterator >::undelayPosition(), and inet::physicallayer::TimeMappingIterator< Interpolator >::updateNextPos().
|
friend |
Output operator for Arguments.
Produces output of form "(x1, x2, x3, <...>)".
|
static |
One value of a Argument value.
Referenced by inet::physicallayer::LinearIntplMapping::getValue().
|
static |
Zero value of a Argument value.
Referenced by inet::physicallayer::DimensionalAnalogModelBase::computeNoise(), inet::physicallayer::IsotropicDimensionalBackgroundNoise::computeNoise(), inet::physicallayer::DimensionalAnalogModelBase::computeReceptionPower(), inet::physicallayer::DimensionalTransmitterBase::createPowerMapping(), getArgValue(), inet::physicallayer::MultiDimMappingIterator< Linear >::getValue(), and inet::physicallayer::MultiDimMapping< Linear >::getValue().
|
protected |
Stores the time dimension in Omnet's time type.
Referenced by compare(), getTime(), isClose(), isSamePosition(), operator=(), operator==(), setArgValues(), and setTime().
|
protected |
Maps the dimensions of this Argument to their values.
Referenced by Argument(), compare(), find(), getArgValue(), hasArgVal(), insertValue(), isClose(), isSamePosition(), lower_bound(), operator=(), operator==(), setArgValue(), and setArgValues().