parent
fe2a580678
commit
d2c4ee1b4c
|
|
@ -12,7 +12,7 @@
|
||||||
#include <linux/pkt_sched.h>
|
#include <linux/pkt_sched.h>
|
||||||
|
|
||||||
#define TABLESIZE 16384
|
#define TABLESIZE 16384
|
||||||
#define TABLEFACTOR TCA_NETEM_TABLEFACTOR
|
#define TABLEFACTOR NETEM_DIST_SCALE
|
||||||
|
|
||||||
static double
|
static double
|
||||||
normal(double x, double mu, double sigma)
|
normal(double x, double mu, double sigma)
|
||||||
|
|
@ -38,10 +38,8 @@ main(int argc, char **argv)
|
||||||
table[i] = x;
|
table[i] = x;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf(
|
|
||||||
"# This is the distribution table for the normal distribution.\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
|
printf("# This is the distribution table for the normal distribution.\n");
|
||||||
for (i = n = 0; i < TABLESIZE; i += 4) {
|
for (i = n = 0; i < TABLESIZE; i += 4) {
|
||||||
int value = (int) rint(table[i]*TABLEFACTOR);
|
int value = (int) rint(table[i]*TABLEFACTOR);
|
||||||
if (value < SHRT_MIN) value = SHRT_MIN;
|
if (value < SHRT_MIN) value = SHRT_MIN;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
static const double a=3.0;
|
static const double a=3.0;
|
||||||
#define TABLESIZE 16384
|
#define TABLESIZE 16384
|
||||||
#define TABLEFACTOR TCA_NETEM_TABLEFACTOR
|
#define TABLEFACTOR NETEM_DIST_SCALE
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
|
|
@ -20,9 +20,7 @@ main(int argc, char **argv)
|
||||||
int i, n;
|
int i, n;
|
||||||
double dvalue;
|
double dvalue;
|
||||||
|
|
||||||
printf(
|
printf("# This is the distribution table for the pareto distribution.\n");
|
||||||
"# This is the distribution table for the pareto distribution.\n"
|
|
||||||
);
|
|
||||||
|
|
||||||
for (i = 65536, n = 0; i > 0; i -= 16) {
|
for (i = 65536, n = 0; i > 0; i -= 16) {
|
||||||
dvalue = (double)i/(double)65536;
|
dvalue = (double)i/(double)65536;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
#include <linux/pkt_sched.h>
|
#include <linux/pkt_sched.h>
|
||||||
|
|
||||||
#define TABLESIZE 16384
|
#define TABLESIZE 16384
|
||||||
#define TABLEFACTOR TCA_NETEM_TABLEFACTOR
|
#define TABLEFACTOR NETEM_DIST_SCALE
|
||||||
|
|
||||||
static double
|
static double
|
||||||
normal(double x, double mu, double sigma)
|
normal(double x, double mu, double sigma)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue