core: Update rng example to current API

This commit is contained in:
Tom Henderson
2017-08-01 20:01:53 -07:00
parent a35b036bc1
commit 90a897f20b

View File

@@ -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