2 # Generated python file of Graph GraphSyracuseCEv
9 GraphSyracuseCEv = Graph( 'GraphSyracuseCEv' )
10 GraphSyracuseCEv.SetName( 'GraphSyracuseCEv' )
11 GraphSyracuseCEv.SetAuthor( 'JR' )
12 GraphSyracuseCEv.SetComment( 'Syracuse algorithm' )
13 GraphSyracuseCEv.Coords( 0 , 0 )
15 # Creation of Computing Nodes
16 test_ISEVEN = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
17 test_ISEVEN.SetName( 'test_ISEVEN' )
18 test_ISEVEN.SetAuthor( '' )
19 test_ISEVEN.SetContainer( 'localhost/FactoryServer' )
20 test_ISEVEN.SetComment( '' )
21 test_ISEVEN.Coords( 252 , 266 )
22 test_ISONE = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
23 test_ISONE.SetName( 'test_ISONE' )
24 test_ISONE.SetAuthor( '' )
25 test_ISONE.SetContainer( 'localhost/FactoryServer' )
26 test_ISONE.SetComment( '' )
27 test_ISONE.Coords( 268 , 29 )
28 m3p1 = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
29 m3p1.SetName( 'm3p1' )
31 m3p1.SetContainer( 'localhost/FactoryServer' )
33 m3p1.Coords( 644 , 410 )
34 div2 = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
35 div2.SetName( 'div2' )
37 div2.SetContainer( 'localhost/FactoryServer' )
39 div2.Coords( 648 , 209 )
40 incr = GraphSyracuseCEv.Node( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
41 incr.SetName( 'incr' )
43 incr.SetContainer( 'localhost/FactoryServer' )
45 incr.Coords( 640 , 2 )
47 # Creation of Input datas
48 test_ISEVENanInteger = test_ISEVEN.Input( 'anInteger' , 31)
49 test_ISONEanInteger = test_ISONE.Input( 'anInteger' , 31)
50 m3p1anOddInteger = m3p1.Input( 'anOddInteger' , 31)
51 div2anEvenInteger = div2.Input( 'anEvenInteger' , 31)
52 incraCount = incr.Input( 'aCount' , 0)
54 GraphSyracuseCEv.IsValid()
56 GraphSyracuseCEv.ThreadsMax()
58 GraphSyracuseCEv.LevelMax()
60 GraphSyracuseCEv.GraphsNumber()
62 GraphSyracuseCEv.IsExecutable()
67 exec GraphSyracuseCEv.ListNodes()
69 test_ISEVENanInteger = test_ISEVEN.Port( 'anInteger' )
70 test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' )
71 test_ISONEanInteger = test_ISONE.Port( 'anInteger' )
72 test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' )
73 m3p1anOddInteger = m3p1.Port( 'anOddInteger' )
74 m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' )
75 div2anEvenInteger = div2.Port( 'anEvenInteger' )
76 div2anInteger = div2.Port( 'anInteger' )
77 incraCount = incr.Port( 'aCount' )
78 incraNewCount = incr.Port( 'aNewCount' )
80 GraphSyracuseCEv.Start()
82 test_ISEVEN.SuspendDone()
83 test_ISONE.SuspendDone()
95 aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event()
97 if int( test_ISONEBoolOne.ToString() ) == 0 :
98 if int( test_ISEVENBoolEven.ToString() ) == 0 :
100 if aNode.Name() == 'm3p1' :
101 if aState == SUPERV_idl._0_SUPERV.SuspendReadyState :
105 if aState == SUPERV_idl._0_SUPERV.SuspendDoneState :
106 sts = test_ISEVENanInteger.Input( m3p1anEvenInteger.ToString() )
107 sts = test_ISONEanInteger.Input( m3p1anEvenInteger.ToString() )
108 sts = test_ISEVEN.ReRun()
109 sts = test_ISONE.ReRun()
111 if ( aNode.Name() == 'incr' ) & ( aState == SUPERV_idl._0_SUPERV.SuspendDoneState ) :
112 sts = incraCount.Input( incraNewCount.ToString() )
113 aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event()
114 print incraNewCount.ToString(),"m3p1",m3p1anEvenInteger.ToString()
115 sts = div2anEvenInteger.Input( m3p1anEvenInteger.ToString() )
116 while int( test_ISEVENBoolEven.ToString() ) == 1 :
119 aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event()
120 while aNode != None :
121 if ( aNode.Name() == 'div2' ) & ( aState == SUPERV_idl._0_SUPERV.SuspendDoneState ) :
122 sts = test_ISEVENanInteger.Input( div2anInteger.ToString() )
123 sts = test_ISONEanInteger.Input( div2anInteger.ToString() )
124 sts = test_ISEVEN.ReRun()
125 sts = test_ISONE.ReRun()
126 aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event()
127 sts = incraCount.Input( incraNewCount.ToString() )
128 print incraNewCount.ToString(),"div2",div2anInteger.ToString()
129 sts = m3p1anOddInteger.Input( div2anInteger.ToString() )
130 sts = div2anEvenInteger.Input( div2anInteger.ToString() )
131 if int( test_ISONEBoolOne.ToString() ) == 0 :
134 aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event()
136 GraphSyracuseCEv.PrintThreads()
142 aStatus,aNode,anEvent,aState = GraphSyracuseCEv.Event()
144 GraphSyracuseCEv.DoneW()
145 GraphSyracuseCEv.PrintThreads()
146 GraphSyracuseCEv.PrintPorts()