main.py 558 Bytes
Newer Older
1 2 3 4
from comsdk.graph import *
from comsdk.edge import *
from comsdk.communication import *
from test_funcs.simplest import *
5 6


7
data= {"a":1}
8

9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
pred = Func(func=dummy_predicate)
morph = Func(func=increment_a_edge)
s_1 = State('s_1')
s_2 = State('s_2')
s_3 = State('s_3')
s_1.connect_to(s_2, edge=Edge(pred, morph))
s_2.connect_to(s_3, edge=Edge(pred, morph))
sub_s_1 = State('sub_s_1')
sub_s_2 = State('sub_s_2')
sub_s_1.connect_to(sub_s_2, edge=Edge(pred, morph))
s_2.replace_with_graph(Graph(sub_s_1, sub_s_2))
gr = Graph(s_1, s_3)

gr.init_graph()
gr.run(data)