Пример #1
0
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]})
Пример #2
0
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)
Пример #3
0
class Simulation(sim.Allocation):
    n_samples = sim.Param("Number of Samples", 100)
    n_steps = sim.Param("Steps to Simulate", 20)
Пример #4
0
 class Foo(sim.Allocation):
     n = sim.Param('count', 0)
Пример #5
0
 class Foo(sim.Allocation):
     s = sim.Param("string", 'a string')
     n = sim.Param("number",
                   42,
                   descr="A natural number",
                   options=(1, None))
Пример #6
0
 class Baz(sim.Allocation):
     baz = sim.Param("baz", True)
Пример #7
0
 class Bar(sim.Allocation):
     bar = sim.Param("bar", 'other string', options=['a', 'b', 'c'])
Пример #8
0
    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)))
Пример #9
0
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)