In [1]:
from blackhc import mdp
from blackhc.mdp import example
In [5]:
def save_mdp_to_png(mdp_spec, filename):
with open(filename, 'wb') as file:
file.write(mdp.graph_to_png(mdp_spec.to_graph()))
mdp.display_mdp(mdp_spec)
save_mdp_to_png(example.ONE_ROUND_DMDP, 'one_round_dmdp.png')
save_mdp_to_png(example.ONE_ROUND_NMDP, 'one_round_nmdp.png')
save_mdp_to_png(example.TWO_ROUND_DMDP, 'two_round_dmdp.png')
save_mdp_to_png(example.TWO_ROUND_NMDP, 'two_round_nmdp.png')
save_mdp_to_png(example.MULTI_ROUND_NDMP, 'multi_round_nmdp.png')
In [ ]: