class Amounts(sim.Allocation): init = sim.Param("Initial Value", 0) speed = sim.Normal("speed", 0, .2, descr="Distribution of speeds") radius = sim.Normal("Radius", 1, .2, descr="Distribution of radius") complex = sim.Param("Complex", {'a': [1, 2, 3], 'b': [0, 2, 1], 'c': [1, 4, 9]})
class FooAlloc: a = sim.Bernoulli("a", .2) b = sim.Uniform("b", 0, 10) c = sim.Normal("c", 2, 1) baz = sim.Param( "baz", { 'a': [.0, .1, .5, .9], 'b': [.1, .5, .9, 1], 'c': [False, True, True, False], 'd': [0, 1, 2, -1] }) bazz = sim.Param("bazz", -4) n_steps = sim.Param("steps", 4) n_samples = sim.Param("samples", 100)
class Simulation(sim.Allocation): n_samples = sim.Param("Number of Samples", 100) n_steps = sim.Param("Steps to Simulate", 20)
class Foo(sim.Allocation): n = sim.Param('count', 0)
class Foo(sim.Allocation): s = sim.Param("string", 'a string') n = sim.Param("number", 42, descr="A natural number", options=(1, None))
class Baz(sim.Allocation): baz = sim.Param("baz", True)
class Bar(sim.Allocation): bar = sim.Param("bar", 'other string', options=['a', 'b', 'c'])
class Foo(sim.Allocation): simple = sim.Param("simple", 42) short = sim.Param("short", {'foo': [1, 2], 'bar': ['a', 'b']}) long = sim.Param("long", {'foo': [0] * 100, 'bar': ['a'] * 100}) list = sim.Param("list", list(range(10)))
class Simulation(sim.Allocation): """Simulation parameters for a random walk model.""" n_samples = sim.Param("Number of samples to simulate", 1000) n_steps = sim.Param("Count of steps that each individual takes", 100)