2 # Generated python file of Graph GraphGOTO
6 # Graph creation of GraphGOTO
8 GraphGOTO = Graph( 'GraphGOTO' )
9 GraphGOTO.SetName( 'GraphGOTO' )
10 GraphGOTO.SetAuthor( 'JR' )
11 GraphGOTO.SetComment( 'Syracuse algorithm' )
12 GraphGOTO.Coords( 0 , 0 )
14 # Creation of Factory Nodes
16 test_ISEVEN = GraphGOTO.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( 195 , 417 )
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.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( 201 , 145 )
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.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
39 m3p1.SetName( 'm3p1' )
41 m3p1.SetContainer( 'localhost/FactoryServer' )
42 m3p1.SetComment( 'C_M3P1 from SyrComponent' )
43 m3p1.Coords( 784 , 36 )
44 Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' )
45 Im3p1Gate = m3p1.GetInPort( 'Gate' )
46 Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' )
47 Om3p1Gate = m3p1.GetOutPort( 'Gate' )
49 div2 = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
50 div2.SetName( 'div2' )
52 div2.SetContainer( 'localhost/FactoryServer' )
53 div2.SetComment( 'C_DIV2 from SyrComponent' )
54 div2.Coords( 788 , 409 )
55 Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' )
56 Idiv2Gate = div2.GetInPort( 'Gate' )
57 Odiv2anInteger = div2.GetOutPort( 'anInteger' )
58 Odiv2Gate = div2.GetOutPort( 'Gate' )
60 incr = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
61 incr.SetName( 'incr' )
63 incr.SetContainer( 'localhost/FactoryServer' )
64 incr.SetComment( 'C_INCR from SyrComponent' )
65 incr.Coords( 788 , 230 )
66 IincraCount = incr.GetInPort( 'aCount' )
67 IincrGate = incr.GetInPort( 'Gate' )
68 OincraNewCount = incr.GetOutPort( 'aNewCount' )
69 OincrGate = incr.GetOutPort( 'Gate' )
71 # Creation of InLine Nodes
73 Pylabel_begin.append( 'def label_begin( NB , KB ):' )
74 Pylabel_begin.append( ' print "label_begin",NB,KB' )
75 Pylabel_begin.append( ' return NB,KB' )
76 label_begin = GraphGOTO.INode( 'label_begin' , Pylabel_begin )
77 label_begin.SetName( 'label_begin' )
78 label_begin.SetAuthor( '' )
79 label_begin.SetComment( 'Python function' )
80 label_begin.Coords( 9 , 250 )
81 Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' )
82 Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' )
83 Ilabel_beginGate = label_begin.GetInPort( 'Gate' )
84 Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' )
85 Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' )
86 Olabel_beginGate = label_begin.GetOutPort( 'Gate' )
89 Pylabel_test.append( 'def label_test( ValEven , ValOne , NB , KB ):' )
90 Pylabel_test.append( ' print "label_begin",ValEven,ValOne,NB,KB' )
91 Pylabel_test.append( ' return ValEven,ValOne,NB,KB' )
92 label_test = GraphGOTO.INode( 'label_test' , Pylabel_test )
93 label_test.SetName( 'label_test' )
94 label_test.SetAuthor( '' )
95 label_test.SetComment( 'Python function' )
96 label_test.Coords( 396 , 193 )
97 Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' )
98 Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' )
99 Ilabel_testNT = label_test.InPort( 'NT' , 'long' )
100 Ilabel_testKT = label_test.InPort( 'KT' , 'long' )
101 Ilabel_testGate = label_test.GetInPort( 'Gate' )
102 Olabel_testValEven = label_test.OutPort( 'ValEven' , 'long' )
103 Olabel_testValOne = label_test.OutPort( 'ValOne' , 'long' )
104 Olabel_testNT = label_test.OutPort( 'NT' , 'long' )
105 Olabel_testKT = label_test.OutPort( 'KT' , 'long' )
106 Olabel_testGate = label_test.GetOutPort( 'Gate' )
108 # Creation of Switch Nodes
110 Pytest.append( 'def Switch_OneEven( ValOne , ValEven , NT , KT ) :' )
111 Pytest.append( ' Finished = ValOne' )
112 Pytest.append( ' if Finished == 0 :' )
113 Pytest.append( ' Incr = 1' )
114 Pytest.append( ' Even = ValEven' )
115 Pytest.append( ' if Even == 0 :' )
116 Pytest.append( ' Odd = 1' )
117 Pytest.append( ' else :' )
118 Pytest.append( ' Odd = 0' )
119 Pytest.append( ' else :' )
120 Pytest.append( ' Incr = 0' )
121 Pytest.append( ' Even = 0' )
122 Pytest.append( ' Odd = 0' )
123 Pytest.append( ' Even = ValEven' )
124 Pytest.append( ' return Finished,Incr,Even,Odd,NT,KT' )
125 test,EndSwitch_OneEven = GraphGOTO.SNode( 'Switch_OneEven' , Pytest )
126 EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' )
127 EndSwitch_OneEven.SetAuthor( '' )
128 EndSwitch_OneEven.SetComment( 'Compute Node' )
129 EndSwitch_OneEven.Coords( 1152 , 292 )
130 PyEndSwitch_OneEven = []
131 PyEndSwitch_OneEven.append( 'def EndSwitch_OneEven( Finished , K ):' )
132 PyEndSwitch_OneEven.append( ' print "label_begin",Finished,K' )
133 PyEndSwitch_OneEven.append( ' return Finished,K' )
134 EndSwitch_OneEven.SetPyFunction( 'EndSwitch_OneEven' , PyEndSwitch_OneEven )
135 IEndSwitch_OneEvenFinished = EndSwitch_OneEven.InPort( 'Finished' , 'long' )
136 IEndSwitch_OneEvenK = EndSwitch_OneEven.InPort( 'K' , 'long' )
137 IEndSwitch_OneEvenDefault = EndSwitch_OneEven.GetInPort( 'Default' )
138 OEndSwitch_OneEvenFinished = EndSwitch_OneEven.OutPort( 'Finished' , 'long' )
139 OEndSwitch_OneEvenK = EndSwitch_OneEven.OutPort( 'K' , 'long' )
140 OEndSwitch_OneEvenGate = EndSwitch_OneEven.GetOutPort( 'Gate' )
141 test.SetName( 'test' )
143 test.SetComment( 'Compute Node' )
144 test.Coords( 595 , 239 )
145 ItestValOne = test.InPort( 'ValOne' , 'long' )
146 ItestValEven = test.InPort( 'ValEven' , 'long' )
147 ItestNT = test.InPort( 'NT' , 'long' )
148 ItestKT = test.InPort( 'KT' , 'long' )
149 ItestGate = test.GetInPort( 'Gate' )
150 OtestFinished = test.OutPort( 'Finished' , 'long' )
151 OtestIncr = test.OutPort( 'Incr' , 'long' )
152 OtestEven = test.OutPort( 'Even' , 'long' )
153 OtestOdd = test.OutPort( 'Odd' , 'long' )
154 OtestN = test.OutPort( 'N' , 'long' )
155 OtestK = test.OutPort( 'K' , 'long' )
156 OtestDefault = test.GetOutPort( 'Default' )
158 # Creation of GOTO Nodes
160 Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' )
161 Pycontrol_m3p1.append( ' return 0,1,N,K' )
162 control_m3p1 = GraphGOTO.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' )
163 control_m3p1.SetName( 'control_m3p1' )
164 control_m3p1.SetAuthor( '' )
165 control_m3p1.SetComment( 'Compute Node' )
166 control_m3p1.Coords( 980 , 81 )
167 Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' )
168 Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' )
169 Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' )
170 Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' )
171 Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' )
172 Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' )
173 Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' )
174 Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' )
177 Pycontrol_div2.append( 'def control_div2( N , NB ) :' )
178 Pycontrol_div2.append( ' return N,NB' )
179 control_div2 = GraphGOTO.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' )
180 control_div2.SetName( 'control_div2' )
181 control_div2.SetAuthor( '' )
182 control_div2.SetComment( 'Compute Node' )
183 control_div2.Coords( 1039 , 454 )
184 Icontrol_div2N = control_div2.InPort( 'N' , 'long' )
185 Icontrol_div2K = control_div2.InPort( 'K' , 'long' )
186 Icontrol_div2Gate = control_div2.GetInPort( 'Gate' )
187 Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' )
188 Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' )
189 Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' )
192 Ltest_ISEVENBoolEvenlabel_testValEven = GraphGOTO.Link( Otest_ISEVENBoolEven , Ilabel_testValEven )
193 Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 369 , 273 )
194 Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 370 , 498 )
196 Ltest_ISONEBoolOnelabel_testValOne = GraphGOTO.Link( Otest_ISONEBoolOne , Ilabel_testValOne )
197 Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 385 , 303 )
198 Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 384 , 225 )
200 Lm3p1anEvenIntegercontrol_m3p1N = GraphGOTO.Link( Om3p1anEvenInteger , Icontrol_m3p1N )
202 Ldiv2anIntegercontrol_div2N = GraphGOTO.Link( Odiv2anInteger , Icontrol_div2N )
204 LincraNewCountcontrol_m3p1K = GraphGOTO.Link( OincraNewCount , Icontrol_m3p1K )
205 LincraNewCountcontrol_m3p1K.AddCoord( 1 , 964 , 145 )
206 LincraNewCountcontrol_m3p1K.AddCoord( 2 , 964 , 309 )
208 LincraNewCountcontrol_div2K = GraphGOTO.Link( OincraNewCount , Icontrol_div2K )
209 LincraNewCountcontrol_div2K.AddCoord( 1 , 963 , 518 )
210 LincraNewCountcontrol_div2K.AddCoord( 2 , 964 , 312 )
212 Llabel_beginNTlabel_testNT = GraphGOTO.Link( Olabel_beginNT , Ilabel_testNT )
214 Llabel_beginNTtest_ISONEanInteger = GraphGOTO.Link( Olabel_beginNT , Itest_ISONEanInteger )
215 Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 192 , 226 )
216 Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 191 , 331 )
218 Llabel_beginNTtest_ISEVENanInteger = GraphGOTO.Link( Olabel_beginNT , Itest_ISEVENanInteger )
219 Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 191 , 494 )
220 Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 192 , 331 )
222 Llabel_beginKTlabel_testKT = GraphGOTO.Link( Olabel_beginKT , Ilabel_testKT )
224 Llabel_testValEventestValEven = GraphGOTO.Link( Olabel_testValEven , ItestValEven )
225 Llabel_testValEventestValEven.AddCoord( 1 , 587 , 318 )
226 Llabel_testValEventestValEven.AddCoord( 2 , 570 , 318 )
227 Llabel_testValEventestValEven.AddCoord( 3 , 569 , 272 )
229 Llabel_testValOnetestValOne = GraphGOTO.Link( Olabel_testValOne , ItestValOne )
230 Llabel_testValOnetestValOne.AddCoord( 1 , 585 , 273 )
231 Llabel_testValOnetestValOne.AddCoord( 2 , 586 , 303 )
233 Llabel_testNTtestNT = GraphGOTO.Link( Olabel_testNT , ItestNT )
235 Llabel_testKTtestKT = GraphGOTO.Link( Olabel_testKT , ItestKT )
237 LtestFinishedEndSwitch_OneEvenFinished = GraphGOTO.Link( OtestFinished , IEndSwitch_OneEvenFinished )
239 LtestIncrincrGate = GraphGOTO.Link( OtestIncr , IincrGate )
240 LtestIncrincrGate.AddCoord( 1 , 783 , 341 )
241 LtestIncrincrGate.AddCoord( 2 , 782 , 302 )
243 LtestEvendiv2Gate = GraphGOTO.Link( OtestEven , Idiv2Gate )
244 LtestEvendiv2Gate.AddCoord( 1 , 754 , 518 )
245 LtestEvendiv2Gate.AddCoord( 2 , 753 , 330 )
247 LtestOddm3p1Gate = GraphGOTO.Link( OtestOdd , Im3p1Gate )
248 LtestOddm3p1Gate.AddCoord( 1 , 758 , 145 )
249 LtestOddm3p1Gate.AddCoord( 2 , 760 , 359 )
251 LtestNm3p1anOddInteger = GraphGOTO.Link( OtestN , Im3p1anOddInteger )
252 LtestNm3p1anOddInteger.AddCoord( 1 , 767 , 116 )
253 LtestNm3p1anOddInteger.AddCoord( 2 , 767 , 116 )
254 LtestNm3p1anOddInteger.AddCoord( 3 , 767 , 390 )
256 LtestNdiv2anEvenInteger = GraphGOTO.Link( OtestN , Idiv2anEvenInteger )
257 LtestNdiv2anEvenInteger.AddCoord( 1 , 767 , 489 )
258 LtestNdiv2anEvenInteger.AddCoord( 2 , 766 , 389 )
260 LtestKEndSwitch_OneEvenK = GraphGOTO.Link( OtestK , IEndSwitch_OneEvenK )
262 LtestKincraCount = GraphGOTO.Link( OtestK , IincraCount )
263 LtestKincraCount.AddCoord( 1 , 772 , 311 )
264 LtestKincraCount.AddCoord( 2 , 772 , 417 )
265 LtestKincraCount.AddCoord( 3 , 772 , 417 )
267 LtestDefaultEndSwitch_OneEvenDefault = GraphGOTO.Link( OtestDefault , IEndSwitch_OneEvenDefault )
268 LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 1 , 778 , 384 )
269 LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 2 , 778 , 448 )
271 Lcontrol_m3p1Gatelabel_testGate = GraphGOTO.Link( Ocontrol_m3p1Gate , Ilabel_testGate )
272 Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 388 , 388 )
273 Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 389 , 597 )
274 Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1319 , 597 )
275 Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1318 , 231 )
277 Lcontrol_div2Gatelabel_beginGate = GraphGOTO.Link( Ocontrol_div2Gate , Ilabel_beginGate )
278 Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 4 , 388 )
279 Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 3 , 587 )
280 Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1214 , 588 )
281 Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1213 , 546 )
284 Ilabel_beginNB.Input( 7 )
285 Ilabel_beginKB.Input( 0 )
287 # Output Ports of the graph
288 #OEndSwitch_OneEvenFinished = EndSwitch_OneEven.GetOutPort( 'Finished' )
289 #OEndSwitch_OneEvenK = EndSwitch_OneEven.GetOutPort( 'K' )
293 GraphGOTO = DefGraphGOTO()
299 GraphGOTO.PrintPorts()