InetUnderlayConfigurator.cc File Reference

#include "InetUnderlayConfigurator.h"
#include <vector>
#include <deque>
#include <set>
#include <omnetpp.h>
#include <UnderlayConfigurator.h>
#include <GlobalNodeList.h>
#include <TransportAddress.h>
#include <StringConvert.h>
#include <AccessNet.h>
#include <IRoutingTable.h>
#include <IInterfaceTable.h>
#include <IPAddressResolver.h>
#include <IPv4InterfaceData.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_Function (uniform2, 4)
 Define_Function (intuniform2, 4)

Detailed Description

Author:
Markus Mauch, Stephan Krause, Bernhard Heep

Definition in file InetUnderlayConfigurator.cc.


Function Documentation

Define_Function ( intuniform2  ,
 
)
Define_Function ( uniform2  ,
 
)
Define_Module ( InetUnderlayConfigurator   ) 
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