2 # Generated python file of Graph GraphGOTO_2
6 # Graph creation of GraphGOTO_2
8 GraphGOTO_2 = Graph( 'GraphGOTO_2' )
9 GraphGOTO_2.SetName( 'GraphGOTO_2' )
10 GraphGOTO_2.SetAuthor( 'JR' )
11 GraphGOTO_2.SetComment( 'Syracuse algorithm' )
12 GraphGOTO_2.Coords( 0 , 0 )
14 # Creation of Factory Nodes
16 test_ISEVEN = GraphGOTO_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
17 test_ISEVEN.SetName( 'test_ISEVEN' )
18 test_ISEVEN.SetAuthor( '' )
19 test_ISEVEN.SetContainer( 'localhost/FactoryServer' )
20 test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' )
21 test_ISEVEN.Coords( 204 , 420 )
22 Itest_ISEVENanInteger = test_ISEVEN.GetInPort( 'anInteger' )
23 Itest_ISEVENGate = test_ISEVEN.GetInPort( 'Gate' )
24 Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' )
25 Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' )
27 test_ISONE = GraphGOTO_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
28 test_ISONE.SetName( 'test_ISONE' )
29 test_ISONE.SetAuthor( '' )
30 test_ISONE.SetContainer( 'localhost/FactoryServer' )
31 test_ISONE.SetComment( 'C_ISONE from SyrComponent' )
32 test_ISONE.Coords( 208 , 155 )
33 Itest_ISONEanInteger = test_ISONE.GetInPort( 'anInteger' )
34 Itest_ISONEGate = test_ISONE.GetInPort( 'Gate' )
35 Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' )
36 Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' )
38 m3p1 = GraphGOTO_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
39 m3p1.SetName( 'm3p1' )
41 m3p1.SetContainer( 'localhost/FactoryServer' )
42 m3p1.SetComment( 'C_M3P1 from SyrComponent' )
43 m3p1.Coords( 861 , 46 )
44 Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' )
45 Im3p1Gate = m3p1.GetInPort( 'Gate' )
46 Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' )
47 Om3p1Gate = m3p1.GetOutPort( 'Gate' )
49 div2 = GraphGOTO_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
50 div2.SetName( 'div2' )
52 div2.SetContainer( 'localhost/FactoryServer' )
53 div2.SetComment( 'C_DIV2 from SyrComponent' )
54 div2.Coords( 858 , 466 )
55 Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' )
56 Idiv2Gate = div2.GetInPort( 'Gate' )
57 Odiv2anInteger = div2.GetOutPort( 'anInteger' )
58 Odiv2Gate = div2.GetOutPort( 'Gate' )
60 incr = GraphGOTO_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
61 incr.SetName( 'incr' )
63 incr.SetContainer( 'localhost/FactoryServer' )
64 incr.SetComment( 'C_INCR from SyrComponent' )
65 incr.Coords( 865 , 169 )
66 IincraCount = incr.GetInPort( 'aCount' )
67 IincrGate = incr.GetInPort( 'Gate' )
68 OincraNewCount = incr.GetOutPort( 'aNewCount' )
69 OincrGate = incr.GetOutPort( 'Gate' )
71 incr_1 = GraphGOTO_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
72 incr_1.SetName( 'incr_1' )
73 incr_1.SetAuthor( '' )
74 incr_1.SetContainer( 'localhost/FactoryServer' )
75 incr_1.SetComment( 'C_INCR from SyrComponent' )
76 incr_1.Coords( 859 , 338 )
77 Iincr_1aCount = incr_1.GetInPort( 'aCount' )
78 Iincr_1Gate = incr_1.GetInPort( 'Gate' )
79 Oincr_1aNewCount = incr_1.GetOutPort( 'aNewCount' )
80 Oincr_1Gate = incr_1.GetOutPort( 'Gate' )
82 # Creation of InLine Nodes
84 Pylabel_begin.append( 'def label_begin( NB , KB ):' )
85 Pylabel_begin.append( ' print "label_begin",NB,KB' )
86 Pylabel_begin.append( ' return NB,KB' )
87 label_begin = GraphGOTO_2.INode( 'label_begin' , Pylabel_begin )
88 label_begin.SetName( 'label_begin' )
89 label_begin.SetAuthor( '' )
90 label_begin.SetComment( 'Python function' )
91 label_begin.Coords( 10 , 260 )
92 Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' )
93 Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' )
94 Ilabel_beginGate = label_begin.GetInPort( 'Gate' )
95 Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' )
96 Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' )
97 Olabel_beginGate = label_begin.GetOutPort( 'Gate' )
100 Pylabel_test.append( 'def label_test( ValEven , ValOne , NB , KB ):' )
101 Pylabel_test.append( ' print "label_begin",ValEven,ValOne,NB,KB' )
102 Pylabel_test.append( ' return ValEven,ValOne,NB,KB' )
103 label_test = GraphGOTO_2.INode( 'label_test' , Pylabel_test )
104 label_test.SetName( 'label_test' )
105 label_test.SetAuthor( '' )
106 label_test.SetComment( 'Python function' )
107 label_test.Coords( 400 , 220 )
108 Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' )
109 Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' )
110 Ilabel_testNT = label_test.InPort( 'NT' , 'long' )
111 Ilabel_testKT = label_test.InPort( 'KT' , 'long' )
112 Ilabel_testGate = label_test.GetInPort( 'Gate' )
113 Olabel_testValEven = label_test.OutPort( 'ValEven' , 'long' )
114 Olabel_testValOne = label_test.OutPort( 'ValOne' , 'long' )
115 Olabel_testNT = label_test.OutPort( 'NT' , 'long' )
116 Olabel_testKT = label_test.OutPort( 'KT' , 'long' )
117 Olabel_testGate = label_test.GetOutPort( 'Gate' )
119 # Creation of Switch Nodes
121 Pytest.append( 'def Switch_OneEven( ValOne , ValEven , NT , KT ) :' )
122 Pytest.append( ' Finished = ValOne' )
123 Pytest.append( ' if Finished == 0 :' )
124 Pytest.append( ' Incr = 1' )
125 Pytest.append( ' Even = ValEven' )
126 Pytest.append( ' if Even == 0 :' )
127 Pytest.append( ' Odd = 1' )
128 Pytest.append( ' else :' )
129 Pytest.append( ' Odd = 0' )
130 Pytest.append( ' else :' )
131 Pytest.append( ' Incr = 0' )
132 Pytest.append( ' Even = 0' )
133 Pytest.append( ' Odd = 0' )
134 Pytest.append( ' Even = ValEven' )
135 Pytest.append( ' return Finished,Incr,Even,Odd,NT,KT' )
136 test,EndSwitch_OneEven = GraphGOTO_2.SNode( 'Switch_OneEven' , Pytest )
137 EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' )
138 EndSwitch_OneEven.SetAuthor( '' )
139 EndSwitch_OneEven.SetComment( 'Compute Node' )
140 EndSwitch_OneEven.Coords( 1331 , 310 )
141 PyEndSwitch_OneEven = []
142 PyEndSwitch_OneEven.append( 'def EndSwitch_OneEven( Finished , K ):' )
143 PyEndSwitch_OneEven.append( ' print "label_begin",Finished,K' )
144 PyEndSwitch_OneEven.append( ' return Finished,K' )
145 EndSwitch_OneEven.SetPyFunction( 'EndSwitch_OneEven' , PyEndSwitch_OneEven )
146 IEndSwitch_OneEvenFinished = EndSwitch_OneEven.InPort( 'Finished' , 'long' )
147 IEndSwitch_OneEvenK = EndSwitch_OneEven.InPort( 'K' , 'long' )
148 IEndSwitch_OneEvenDefault = EndSwitch_OneEven.GetInPort( 'Default' )
149 OEndSwitch_OneEvenFinished = EndSwitch_OneEven.OutPort( 'Finished' , 'long' )
150 OEndSwitch_OneEvenK = EndSwitch_OneEven.OutPort( 'K' , 'long' )
151 OEndSwitch_OneEvenGate = EndSwitch_OneEven.GetOutPort( 'Gate' )
152 test.SetName( 'test' )
154 test.SetComment( 'Compute Node' )
155 test.Coords( 596 , 260 )
156 ItestValOne = test.InPort( 'ValOne' , 'long' )
157 ItestValEven = test.InPort( 'ValEven' , 'long' )
158 ItestNT = test.InPort( 'NT' , 'long' )
159 ItestKT = test.InPort( 'KT' , 'long' )
160 ItestGate = test.GetInPort( 'Gate' )
161 OtestFinished = test.OutPort( 'Finished' , 'long' )
162 OtestIncr = test.OutPort( 'Incr' , 'long' )
163 OtestEven = test.OutPort( 'Even' , 'long' )
164 OtestOdd = test.OutPort( 'Odd' , 'long' )
165 OtestN = test.OutPort( 'N' , 'long' )
166 OtestK = test.OutPort( 'K' , 'long' )
167 OtestDefault = test.GetOutPort( 'Default' )
169 # Creation of GOTO Nodes
171 Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' )
172 Pycontrol_m3p1.append( ' return 0,1,N,K' )
173 control_m3p1 = GraphGOTO_2.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' )
174 control_m3p1.SetName( 'control_m3p1' )
175 control_m3p1.SetAuthor( '' )
176 control_m3p1.SetComment( 'Compute Node' )
177 control_m3p1.Coords( 1073 , 86 )
178 Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' )
179 Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' )
180 Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' )
181 Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' )
182 Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' )
183 Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' )
184 Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' )
185 Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' )
188 Pycontrol_div2.append( 'def control_div2( N , NB ) :' )
189 Pycontrol_div2.append( ' return N,NB' )
190 control_div2 = GraphGOTO_2.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' )
191 control_div2.SetName( 'control_div2' )
192 control_div2.SetAuthor( '' )
193 control_div2.SetComment( 'Compute Node' )
194 control_div2.Coords( 1128 , 453 )
195 Icontrol_div2N = control_div2.InPort( 'N' , 'long' )
196 Icontrol_div2K = control_div2.InPort( 'K' , 'long' )
197 Icontrol_div2Gate = control_div2.GetInPort( 'Gate' )
198 Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' )
199 Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' )
200 Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' )
203 Ltest_ISEVENBoolEvenlabel_testValEven = GraphGOTO_2.Link( Otest_ISEVENBoolEven , Ilabel_testValEven )
204 Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 374 , 290 )
205 Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 374 , 491 )
207 Ltest_ISONEBoolOnelabel_testValOne = GraphGOTO_2.Link( Otest_ISONEBoolOne , Ilabel_testValOne )
208 Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 385 , 311 )
209 Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 385 , 226 )
211 Lm3p1anEvenIntegercontrol_m3p1N = GraphGOTO_2.Link( Om3p1anEvenInteger , Icontrol_m3p1N )
213 Ldiv2anIntegercontrol_div2N = GraphGOTO_2.Link( Odiv2anInteger , Icontrol_div2N )
215 LincraNewCountcontrol_m3p1K = GraphGOTO_2.Link( OincraNewCount , Icontrol_m3p1K )
216 LincraNewCountcontrol_m3p1K.AddCoord( 1 , 1048 , 135 )
217 LincraNewCountcontrol_m3p1K.AddCoord( 2 , 1048 , 241 )
219 Lincr_1aNewCountcontrol_div2K = GraphGOTO_2.Link( Oincr_1aNewCount , Icontrol_div2K )
221 Llabel_beginNTlabel_testNT = GraphGOTO_2.Link( Olabel_beginNT , Ilabel_testNT )
223 Llabel_beginNTtest_ISONEanInteger = GraphGOTO_2.Link( Olabel_beginNT , Itest_ISONEanInteger )
224 Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 191 , 225 )
225 Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 191 , 331 )
227 Llabel_beginNTtest_ISEVENanInteger = GraphGOTO_2.Link( Olabel_beginNT , Itest_ISEVENanInteger )
228 Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 190 , 491 )
229 Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 190 , 331 )
231 Llabel_beginKTlabel_testKT = GraphGOTO_2.Link( Olabel_beginKT , Ilabel_testKT )
233 Llabel_testValEventestValEven = GraphGOTO_2.Link( Olabel_testValEven , ItestValEven )
235 Llabel_testValOnetestValOne = GraphGOTO_2.Link( Olabel_testValOne , ItestValOne )
237 Llabel_testNTtestNT = GraphGOTO_2.Link( Olabel_testNT , ItestNT )
239 Llabel_testKTtestKT = GraphGOTO_2.Link( Olabel_testKT , ItestKT )
241 LtestFinishedEndSwitch_OneEvenFinished = GraphGOTO_2.Link( OtestFinished , IEndSwitch_OneEvenFinished )
243 LtestEvenincr_1Gate = GraphGOTO_2.Link( OtestEven , Iincr_1Gate )
245 LtestEvendiv2Gate = GraphGOTO_2.Link( OtestEven , Idiv2Gate )
247 LtestOddincrGate = GraphGOTO_2.Link( OtestOdd , IincrGate )
249 LtestOddm3p1Gate = GraphGOTO_2.Link( OtestOdd , Im3p1Gate )
251 LtestNm3p1anOddInteger = GraphGOTO_2.Link( OtestN , Im3p1anOddInteger )
252 LtestNm3p1anOddInteger.AddCoord( 1 , 808 , 116 )
253 LtestNm3p1anOddInteger.AddCoord( 2 , 806 , 372 )
255 LtestNdiv2anEvenInteger = GraphGOTO_2.Link( OtestN , Idiv2anEvenInteger )
256 LtestNdiv2anEvenInteger.AddCoord( 1 , 806 , 537 )
257 LtestNdiv2anEvenInteger.AddCoord( 2 , 806 , 373 )
259 LtestKEndSwitch_OneEvenK = GraphGOTO_2.Link( OtestK , IEndSwitch_OneEvenK )
261 LtestKincraCount = GraphGOTO_2.Link( OtestK , IincraCount )
263 LtestKincr_1aCount = GraphGOTO_2.Link( OtestK , Iincr_1aCount )
265 LtestDefaultEndSwitch_OneEvenDefault = GraphGOTO_2.Link( OtestDefault , IEndSwitch_OneEvenDefault )
266 LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 1 , 1319 , 385 )
267 LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 2 , 1319 , 577 )
268 LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 3 , 779 , 577 )
269 LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 4 , 778 , 415 )
271 Lcontrol_m3p1Gatelabel_testGate = GraphGOTO_2.Link( Ocontrol_m3p1Gate , Ilabel_testGate )
272 Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 389 , 375 )
273 Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 389 , 597 )
274 Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1519 , 602 )
275 Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1508 , 201 )
277 Lcontrol_div2Gatelabel_beginGate = GraphGOTO_2.Link( Ocontrol_div2Gate , Ilabel_beginGate )
278 Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 3 , 373 )
279 Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 3 , 587 )
280 Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1307 , 586 )
281 Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1307 , 528 )
284 Ilabel_beginNB.Input( 7 )
285 Ilabel_beginKB.Input( 0 )
287 # Output Ports of the graph
288 #OtestIncr = test.GetOutPort( 'Incr' )
289 #OEndSwitch_OneEvenFinished = EndSwitch_OneEven.GetOutPort( 'Finished' )
290 #OEndSwitch_OneEvenK = EndSwitch_OneEven.GetOutPort( 'K' )
294 GraphGOTO_2 = DefGraphGOTO_2()