--
You received this message because you are subscribed to a topic in the Google Groups "OMNeT++ Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/omnetpp/LEJikrih_9I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to omnetpp+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
#include <omnetpp.h>
double runiform(double rng) {
static int r = 0;
static double l = 0;
if(r%2 == 0) l = uniform(0,1);
r++;
return l;
}
static cNEDValue runiform(cComponent *context, cNEDValue argv[], int argc)
{
double rng = argc==2 ? (int)argv[1] : 0;
return cNEDValue(runiform(rng), argv[0].getUnit());
}
Define_NED_Function2(runiform, "quantity runiform(double rng?)", "random/continuous", "Retains the value generated from a previous call to uniform()");