From 90a897f20be66632a19d54253fced6defaa50c02 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Tue, 1 Aug 2017 20:01:53 -0700 Subject: [PATCH] core: Update rng example to current API --- src/core/examples/sample-rng-plot.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/examples/sample-rng-plot.py b/src/core/examples/sample-rng-plot.py index eef70a851..a01f6f5b9 100644 --- a/src/core/examples/sample-rng-plot.py +++ b/src/core/examples/sample-rng-plot.py @@ -22,7 +22,9 @@ import matplotlib.pyplot as plt import ns.core # mu, var = 100, 225 -rng = ns.core.NormalVariable(100.0, 225.0) +rng = ns.core.NormalRandomVariable() +rng.SetAttribute("Mean", ns.core.DoubleValue(100.0)) +rng.SetAttribute("Variance", ns.core.DoubleValue(225.0)) x = [rng.GetValue() for t in range(10000)] # the histogram of the data