Exemplo n.º 1
0
            func=lambda h, r: h * r,
            argmap=[
                "Lynx",
                .25
                ]
            ),
        Flow(
            name="LynxDeaths",
            qunit="Lynx",
            tunit="Month",
            func=lynx_starvation,
            argmap=[
                AREA,
                "Hares",
                "Lynx"
                ]
            )
        ],
    # log=True
    log=False
    )

plotter = plot.Plotter(100)
width = 10000
symbols = ["h", "b", "d", "L", "B", "D"]
state = s.state(show_ids=True)
print state
plotter.plot_dumbly(s.state(), -width, width, symbols=symbols)
for i in s.run(20):                      # now run it for some number of steps
    plotter.plot_dumbly(i, -width, width, symbols=symbols)
Exemplo n.º 2
0
        Flow(                           # another flow!
            name="Overflow",            # you know the drill!
            func=overflowflow,
            argmap=[
                "Cup",
                5
                ],
            qunit="Ounce",
            tunit="Second"
            )
        ],
    log=False
    )

print s.env
print s.state()
plotter = plot.Plotter(100)
plotter.plot_dumbly(s.state(), 0, 6)
for i in s.run(20):                      # now run it for some number of steps
    plotter.plot_dumbly(i, 0, 6)

# lines = list(s.run(20))
# print lines
# plotter = plot.Plotter(100, [])
# for line in lines:
#     plotter.plotline(line, 0, 10)
# # for line in lines:
#     plotter.addline(line[0], list(reversed(line[1])))  # yuck
# plotter.plot()
# print [s.next() for i in range(10)]
# print s.env()