Esempio n. 1
0
from dicebreaker import Config, Die, Model_SR, Runner
from dicechart import DiceChart

d6 = Die(6)
######################################
cfg = Config();
cfg.objective_max = 11
cfg.num_max = 11
cfg.iterations = 10

runner = Runner(cfg, d6)
results = runner.run()

dc = DiceChart(results, cfg.iterations)
dc.download("dice-10.png")
######################################
cfg = Config();
cfg.objective_max = 11
cfg.num_max = 11
cfg.iterations = 100

runner = Runner(cfg, d6)
results = runner.run()

dc = DiceChart(results, cfg.iterations)
dc.download("dice-100.png")
#######################################
cfg = Config();
cfg.objective_max = 11
cfg.num_max = 11
cfg.iterations = 1000
Esempio n. 2
0
n1 = Model_SR(dmock, 1, 1)
print n1.name
assert n1.name == "Model_D3_N1", "n1.name"

n2 = Model_SR(dmock, 2, 1)
print n2.name
assert n2.name == "Model_D3_N2", "n2.name"

fix_1 = [3]
fix_2 = [3,3]

t1 = n1.throw(1)
print t1
assert t1 == fix_1, "n1.throw(1)"

t2 = n2.throw(2)
print t2
assert t2 == fix_2, "n2.throw(2)"


rr_fix_1 = {1:[1.0]}
rr_fix_2 = {1:[1.0]}

r = Runner(cmock, dmock)
#print r

rr = r.run()
print rr
assert rr == rr_fix_1, "r.run()"