OverSim
InetUnderlayConfigurator.h File Reference
#include <vector>
#include <deque>
#include <set>
#include <omnetpp.h>
#include <UnderlayConfigurator.h>

Go to the source code of this file.

Classes

class  InetUnderlayConfigurator
 Configurator module for the InetUnderlay. More...

Functions

double uniform2 (double start, double end, double index, double new_calc)
 Extended uniform() function.
double intuniform2 (double start, double end, double index, double new_calc)
 Extended intuniform() function.

Detailed Description

Author
Markus Mauch, Stephan Krause, Bernhard Heep

Definition in file InetUnderlayConfigurator.h.

Function Documentation

double intuniform2 ( double  start,
double  end,
double  index,
double  new_calc 
)

Extended intuniform() function.

Parameters
startstart value
endend value
indexposition of the new value in the static vector
new_calc'1' if a new random number should be generated
Returns
the random number at position index in the double vector

Definition at line 642 of file InetUnderlayConfigurator.cc.

{
static std::vector<double> value;
if ( (unsigned int)index >= value.size() )
value.resize((int)index + 1);
if ( new_calc == 1 )
value[(int)index] = (double)intuniform((int)start, (int)end);
return value[(int)index];
};
double uniform2 ( double  start,
double  end,
double  index,
double  new_calc 
)

Extended uniform() function.

Parameters
startstart value
endend value
indexposition of the new value in the static vector
new_calc'1' if a new random number should be generated
Returns
the random number at position index in the double vector

Definition at line 623 of file InetUnderlayConfigurator.cc.

{
static std::vector<double> value;
if ( (unsigned int)index >= value.size() )
value.resize((int)index + 1);
if ( new_calc == 1 )
value[(int)index] = uniform(start, end);
return value[(int)index];
};