FLAME  devel
 All Classes Functions Variables Typedefs Enumerations Pages
examples/sim.py
1 #!/usr/bin/env python
2 
3 import sys
4 "[includes]"
5 from flame import Machine
6 "[includes]"
7 
8 "[Parse lattice file]"
9 with open(sys.argv[1], "r") as F:
10  mymachine = Machine(F)
11 "[Parse lattice file]"
12 
13 "[Allocate State]"
14 thestate = mymachine.allocState({})
15 "[Allocate State]"
16 
17 print "Initial state", thestate
18 
19 "[Run simulation]"
20 mymachine.propagate(thestate)
21 "[Run simulation]"
22 
23 print "Final state", thestate