Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
from transitions.extensions.factory import HierarchicalGraphMachine
import graphviz
from IPython import display
Fruit = {'name': 'Fruit', 'states': ['forbidden', 'tasty'], 'transitions': [['god_says', 'tasty', 'forbidden'],['serpent_says', 'forbidden', 'tasty']], 'initial': 'forbidden'}
Sinned = {'name': 'Sinned', 'states': ['True', 'False'], 'transitions':[['eat_fruit', 'False', 'True'],['repent', 'True', 'False']], 'initial': 'False'}
GodIs = {'name': 'GodIs', 'states': ['Benevolent', 'Vengeful'],'transitions': [['eat_fruit', 'Benevolent', 'Vengeful'],['forgiven', 'Vengeful', 'Benevolent']], 'initial': 'Benevolent'}
Beliefs = {'name': 'Beliefs', 'parallel': [Fruit, Sinned, GodIs]}
Ate_Fruit = {'name': 'Ate', 'states': ['True', 'False'], 'transitions': [['eat_fruit', 'False', 'True'],['vomit', 'True', 'True']], 'initial': 'False'}
states = [{'name': 'Self', 'parallel': [Beliefs, Ate_Fruit]}]
Eve = HierarchicalGraphMachine(states=states, initial=['Self_Beliefs_GodIs_Benevolent', 'Self_Beliefs_Sinned_False', 'Self_Beliefs_Fruit_forbidden' ,'Self_Ate_False'])
Eve.serpent_says()
Eve.eat_fruit()