2 # Generated python file of Graph GraphSyracuseC_Void
6 GraphSyracuseC_Void = Graph( 'GraphSyracuseC_Void' )
7 print GraphSyracuseC_Void.SetName( 'GraphSyracuseC_Void' )
8 print GraphSyracuseC_Void.SetAuthor( 'JR' )
9 print GraphSyracuseC_Void.SetComment( 'Syracuse algorithm' )
10 GraphSyracuseC_Void.Coords( 0 , 0 )
13 test_ISEVEN = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
14 print test_ISEVEN.SetName( 'test_ISEVEN' )
15 print test_ISEVEN.SetAuthor( '' )
16 print test_ISEVEN.SetContainer( 'localhost/FactoryServer' )
17 print test_ISEVEN.SetComment( '' )
18 test_ISEVEN.Coords( 5 , 416 )
19 test_ISONE = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
20 print test_ISONE.SetName( 'test_ISONE' )
21 print test_ISONE.SetAuthor( '' )
22 print test_ISONE.SetContainer( 'localhost/FactoryServer' )
23 print test_ISONE.SetComment( '' )
24 test_ISONE.Coords( 7 , 232 )
25 m3p1 = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
26 print m3p1.SetName( 'm3p1' )
27 print m3p1.SetAuthor( '' )
28 print m3p1.SetContainer( 'localhost/FactoryServer' )
29 print m3p1.SetComment( '' )
30 m3p1.Coords( 180 , 417 )
31 div2 = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
32 print div2.SetName( 'div2' )
33 print div2.SetAuthor( '' )
34 print div2.SetContainer( 'localhost/FactoryServer' )
35 print div2.SetComment( '' )
36 div2.Coords( 435 , 7 )
37 div2_ISEVEN = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
38 print div2_ISEVEN.SetName( 'div2_ISEVEN' )
39 print div2_ISEVEN.SetAuthor( '' )
40 print div2_ISEVEN.SetContainer( 'localhost/FactoryServer' )
41 print div2_ISEVEN.SetComment( '' )
42 div2_ISEVEN.Coords( 619 , 191 )
43 div2_ISONE = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
44 print div2_ISONE.SetName( 'div2_ISONE' )
45 print div2_ISONE.SetAuthor( '' )
46 print div2_ISONE.SetContainer( 'localhost/FactoryServer' )
47 print div2_ISONE.SetComment( '' )
48 div2_ISONE.Coords( 616 , 6 )
49 incr = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
50 print incr.SetName( 'incr' )
51 print incr.SetAuthor( '' )
52 print incr.SetContainer( 'localhost/FactoryServer' )
53 print incr.SetComment( '' )
54 incr.Coords( 434 , 193 )
56 # Creation of intermediate Output variables and of links
57 test_ISEVENOutVoid = test_ISEVEN.Port( 'OutVoid' )
58 m3p1InVoid = GraphSyracuseC_Void.Link( test_ISEVENOutVoid , m3p1.Port( 'InVoid' ) )
59 m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' )
60 div2anEvenInteger = GraphSyracuseC_Void.Link( m3p1anEvenInteger , div2.Port( 'anEvenInteger' ) )
61 print div2anEvenInteger.AddCoord( 1 , 368 , 158 )
62 print div2anEvenInteger.AddCoord( 2 , 369 , 568 )
63 div2anInteger = div2.Port( 'anInteger' )
64 div2_ISONEanInteger = GraphSyracuseC_Void.Link( div2anInteger , div2_ISONE.Port( 'anInteger' ) )
65 div2_ISEVENanInteger = GraphSyracuseC_Void.Link( div2anInteger , div2_ISEVEN.Port( 'anInteger' ) )
66 print div2_ISEVENanInteger.AddCoord( 1 , 603 , 342 )
67 print div2_ISEVENanInteger.AddCoord( 2 , 603 , 158 )
69 # Creation of Input datas
70 test_ISEVENanInteger = test_ISEVEN.Input( 'anInteger' , 31)
71 test_ISONEanInteger = test_ISONE.Input( 'anInteger' , 31)
72 m3p1anOddInteger = m3p1.Input( 'anOddInteger' , 31)
73 div2InanEvenInteger = div2.Port( 'anEvenInteger' )
74 incraCount = incr.Input( 'aCount' , 0)
78 # Creation of Output variables
79 test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' )
80 test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' )
81 div2_ISEVENBoolEven = div2_ISEVEN.Port( 'BoolEven' )
82 div2_ISONEBoolOne = div2_ISONE.Port( 'BoolOne' )
83 incraNewCount = incr.Port( 'aNewCount' )
85 GraphSyracuseC_Void.IsValid()
87 GraphSyracuseC_Void.ThreadsMax()
89 GraphSyracuseC_Void.LevelMax()
91 GraphSyracuseC_Void.GraphsNumber()
93 curM3P1 = m3p1.Input( 'anOddInteger' , 31 )
94 curtestISEVEN = test_ISEVEN.Input( 'anInteger' , curM3P1.ToAny() )
95 curtestISONE = test_ISONE.Input( 'anInteger' , curM3P1.ToAny() )
97 GraphSyracuseC_Void.IsExecutable()
99 GraphSyracuseC_Void.Start()
103 div2_ISEVEN.SuspendDone()
104 div2_ISONE.SuspendDone()
109 # Attente de fin d'exécution de test
117 # Etats et Threads des nodes
118 GraphSyracuseC_Void.PrintThreads()
120 BoolOne = int( test_ISONEBoolOne.ToString() )
121 BoolEven = int( test_ISEVENBoolEven.ToString() )
124 sts = div2_ISONE.ReRunAt('m3p1')
128 sts = incraCount.Input( int( incraNewCount.ToString() ) + 1 )
131 Current = int( m3p1anEvenInteger.ToString() )
132 print "m3p1",Current,BoolEven
133 while BoolEven == 1 :
136 sts = div2_ISEVEN.DoneW()
137 sts = div2_ISONE.DoneW()
139 sts = incraCount.Input( incraNewCount.ToString() )
140 BoolOne = int( div2_ISONEBoolOne.ToString() )
141 BoolEven = int( div2_ISEVENBoolEven.ToString() )
142 Current = int( div2anInteger.ToString() )
143 print "div2",Current,BoolEven,BoolOne
145 div2InanEvenInteger.Input( Current )
146 sts = div2_ISONE.ReRunAt('div2')
147 sts = curM3P1.Input( Current )
150 GraphSyracuseC_Void.PrintThreads()
156 GraphSyracuseC_Void.DoneW()
157 print GraphSyracuseC_Void.State()
158 GraphSyracuseC_Void.PrintPorts()
159 GraphSyracuseC_Void.PrintThreads()