OverSim
InetUnderlayConfigurator.cc File Reference
#include "InetUnderlayConfigurator.h"
#include <GlobalNodeList.h>
#include <TransportAddress.h>
#include <StringConvert.h>
#include <AccessNet.h>
#include <IRoutingTable.h>
#include <RoutingTable6.h>
#include <IInterfaceTable.h>
#include <IPAddressResolver.h>
#include <IPv4InterfaceData.h>
#include <IPv6InterfaceData.h>
#include <NotificationBoard.h>
#include <InetInfo.h>

Go to the source code of this file.

Functions

 Define_Module (InetUnderlayConfigurator)
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.
 Define_NED_Math_Function (uniform2, 4)
 Define_NED_Math_Function (intuniform2, 4)

Detailed Description

Author
Markus Mauch, Stephan Krause, Bernhard Heep

Definition in file InetUnderlayConfigurator.cc.

Function Documentation

Define_Module ( InetUnderlayConfigurator  )
Define_NED_Math_Function ( uniform2  ,
 
)
Define_NED_Math_Function ( intuniform2  ,
 
)
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];
};