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:
start start value
end end value
index position 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 518 of file InetUnderlayConfigurator.cc.

00519 {
00520     static std::vector<double> value;
00521     if ( (unsigned int)index >= value.size() )
00522         value.resize((int)index + 1);
00523     if ( new_calc == 1 )
00524         value[(int)index] = (double)intuniform((int)start, (int)end);
00525     return value[(int)index];
00526 };

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

Extended uniform() function.

Parameters:
start start value
end end value
index position 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 499 of file InetUnderlayConfigurator.cc.

00500 {
00501     static std::vector<double> value;
00502     if ( (unsigned int)index >= value.size() )
00503         value.resize((int)index + 1);
00504     if ( new_calc == 1 )
00505         value[(int)index] = uniform(start, end);
00506     return value[(int)index];
00507 };

Generated on Wed May 26 16:21:15 2010 for OverSim by  doxygen 1.6.3