2 # Generated python file of Graph GraphSwitchCheckDefault2NOTValid
6 # Graph creation of GraphSwitchCheckDefault2NOTValid
7 def DefGraphSwitchCheckDefault2NOTValid() :
8 GraphSwitchCheckDefault2NOTValid = Graph( 'GraphSwitchCheckDefault2NOTValid' )
9 GraphSwitchCheckDefault2NOTValid.SetName( 'GraphSwitchCheckDefault2NOTValid' )
10 GraphSwitchCheckDefault2NOTValid.SetAuthor( 'JR' )
11 GraphSwitchCheckDefault2NOTValid.SetComment( '' )
12 GraphSwitchCheckDefault2NOTValid.Coords( 0 , 0 )
14 # Creation of Factory Nodes
16 # Creation of InLine Nodes
18 PyIsOdd.append( 'from time import * ' )
19 PyIsOdd.append( 'def IsOdd(a) : ' )
20 PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' )
21 PyIsOdd.append( ' sleep( 1 ) ' )
22 PyIsOdd.append( ' return a ' )
23 IsOdd = GraphSwitchCheckDefault2NOTValid.INode( 'IsOdd' , PyIsOdd )
24 IsOdd.SetName( 'IsOdd' )
26 IsOdd.SetComment( 'Python function' )
27 IsOdd.Coords( 415 , 7 )
28 IIsOdda = IsOdd.InPort( 'a' , 'long' )
29 IIsOddGate = IsOdd.GetInPort( 'Gate' )
30 OIsOdda = IsOdd.OutPort( 'a' , 'long' )
31 OIsOddGate = IsOdd.GetOutPort( 'Gate' )
34 PyIsEven.append( 'from time import * ' )
35 PyIsEven.append( 'def IsEven(a) : ' )
36 PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' )
37 PyIsEven.append( ' sleep( 1 ) ' )
38 PyIsEven.append( ' return a ' )
39 IsEven = GraphSwitchCheckDefault2NOTValid.INode( 'IsEven' , PyIsEven )
40 IsEven.SetName( 'IsEven' )
41 IsEven.SetAuthor( '' )
42 IsEven.SetComment( 'Compute Node' )
43 IsEven.Coords( 421 , 438 )
44 IIsEvena = IsEven.InPort( 'a' , 'long' )
45 IIsEvenGate = IsEven.GetInPort( 'Gate' )
46 OIsEvena = IsEven.OutPort( 'a' , 'long' )
47 OIsEvenGate = IsEven.GetOutPort( 'Gate' )
50 PyPrintOdd.append( 'from time import * ' )
51 PyPrintOdd.append( 'def Print(a,Branch) : ' )
52 PyPrintOdd.append( ' print "Print ",a,Branch ' )
53 PyPrintOdd.append( ' sleep(1) ' )
54 PyPrintOdd.append( ' return Branch ' )
55 PrintOdd = GraphSwitchCheckDefault2NOTValid.INode( 'Print' , PyPrintOdd )
56 PrintOdd.SetName( 'PrintOdd' )
57 PrintOdd.SetAuthor( '' )
58 PrintOdd.SetComment( 'Compute Node' )
59 PrintOdd.Coords( 415 , 130 )
60 IPrintOdda = PrintOdd.InPort( 'a' , 'long' )
61 IPrintOddBranch = PrintOdd.InPort( 'Branch' , 'string' )
62 IPrintOddGate = PrintOdd.GetInPort( 'Gate' )
63 OPrintOddBranch = PrintOdd.OutPort( 'Branch' , 'string' )
64 OPrintOddGate = PrintOdd.GetOutPort( 'Gate' )
67 PyPrintEven.append( 'from time import * ' )
68 PyPrintEven.append( 'def Print_1(a,Branch) : ' )
69 PyPrintEven.append( ' print "Print ",a,Branch ' )
70 PyPrintEven.append( ' sleep(1) ' )
71 PyPrintEven.append( ' return Branch ' )
72 PrintEven = GraphSwitchCheckDefault2NOTValid.INode( 'Print_1' , PyPrintEven )
73 PrintEven.SetName( 'PrintEven' )
74 PrintEven.SetAuthor( '' )
75 PrintEven.SetComment( 'Compute Node' )
76 PrintEven.Coords( 423 , 289 )
77 IPrintEvena = PrintEven.InPort( 'a' , 'long' )
78 IPrintEvenBranch = PrintEven.InPort( 'Branch' , 'string' )
79 IPrintEvenGate = PrintEven.GetInPort( 'Gate' )
80 OPrintEvenBranch = PrintEven.OutPort( 'Branch' , 'string' )
81 OPrintEvenGate = PrintEven.GetOutPort( 'Gate' )
84 PyEmptyNode.append( 'from time import * ' )
85 PyEmptyNode.append( 'def EmptyNode(a,Branch) : ' )
86 PyEmptyNode.append( ' sleep(1) ' )
87 PyEmptyNode.append( ' return a,Branch ' )
88 EmptyNode = GraphSwitchCheckDefault2NOTValid.INode( 'EmptyNode' , PyEmptyNode )
89 EmptyNode.SetName( 'EmptyNode' )
90 EmptyNode.SetAuthor( '' )
91 EmptyNode.SetComment( 'Compute Node' )
92 EmptyNode.Coords( 652 , 110 )
93 IEmptyNodea = EmptyNode.InPort( 'a' , 'long' )
94 IEmptyNodeBranch = EmptyNode.InPort( 'Branch' , 'string' )
95 IEmptyNodeGate = EmptyNode.GetInPort( 'Gate' )
96 OEmptyNodea = EmptyNode.OutPort( 'a' , 'long' )
97 OEmptyNodeBranch = EmptyNode.OutPort( 'Branch' , 'string' )
98 OEmptyNodeGate = EmptyNode.GetOutPort( 'Gate' )
101 PyDefault.append( 'from time import * ' )
102 PyDefault.append( 'def Default(a,Branch) : ' )
103 PyDefault.append( ' sleep(1) ' )
104 PyDefault.append( ' return a,Branch ' )
105 Default = GraphSwitchCheckDefault2NOTValid.INode( 'Default' , PyDefault )
106 Default.SetName( 'Default' )
107 Default.SetAuthor( '' )
108 Default.SetComment( 'Compute Node' )
109 Default.Coords( 421 , 592 )
110 IDefaulta = Default.InPort( 'a' , 'long' )
111 IDefaultBranch = Default.InPort( 'Branch' , 'string' )
112 IDefaultGate = Default.GetInPort( 'Gate' )
113 ODefaulta = Default.OutPort( 'a' , 'long' )
114 ODefaultBranch = Default.OutPort( 'Branch' , 'string' )
115 ODefaultGate = Default.GetOutPort( 'Gate' )
118 PyPuta.append( 'from time import * ' )
119 PyPuta.append( 'def Puta(a) : ' )
120 PyPuta.append( ' sleep(1) ' )
121 PyPuta.append( ' return a ' )
122 Puta = GraphSwitchCheckDefault2NOTValid.INode( 'Puta' , PyPuta )
123 Puta.SetName( 'Puta' )
125 Puta.SetComment( 'Compute Node' )
126 Puta.Coords( 665 , 486 )
127 IPutaa = Puta.InPort( 'a' , 'long' )
128 IPutaGate = Puta.GetInPort( 'Gate' )
129 OPutaa = Puta.OutPort( 'a' , 'long' )
130 OPutaGate = Puta.GetOutPort( 'Gate' )
133 PyPutBranch.append( 'from time import * ' )
134 PyPutBranch.append( 'def PutBranch(Branch) : ' )
135 PyPutBranch.append( ' sleep(1) ' )
136 PyPutBranch.append( ' return Branch ' )
137 PutBranch = GraphSwitchCheckDefault2NOTValid.INode( 'PutBranch' , PyPutBranch )
138 PutBranch.SetName( 'PutBranch' )
139 PutBranch.SetAuthor( '' )
140 PutBranch.SetComment( 'Compute Node' )
141 PutBranch.Coords( 662 , 613 )
142 IPutBranchBranch = PutBranch.InPort( 'Branch' , 'string' )
143 IPutBranchGate = PutBranch.GetInPort( 'Gate' )
144 OPutBranchBranch = PutBranch.OutPort( 'Branch' , 'string' )
145 OPutBranchGate = PutBranch.GetOutPort( 'Gate' )
147 # Creation of Loop Nodes
148 PyInitLoopSwitch = []
149 PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
150 PyInitLoopSwitch.append( ' Index = Max ' )
151 PyInitLoopSwitch.append( ' return Index,Min,Max ' )
152 PyMoreInitLoopSwitch = []
153 PyMoreInitLoopSwitch.append( 'from time import * ' )
154 PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
155 PyMoreInitLoopSwitch.append( ' sleep(1) ' )
156 PyMoreInitLoopSwitch.append( ' if Index >= Min : ' )
157 PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' )
158 PyMoreInitLoopSwitch.append( ' else : ' )
159 PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' )
160 PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
161 PyNextInitLoopSwitch = []
162 PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
163 PyNextInitLoopSwitch.append( ' Index = Index - 1 ' )
164 PyNextInitLoopSwitch.append( ' return Index,Min,Max ' )
165 InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckDefault2NOTValid.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
166 EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
167 EndOfInitLoopSwitch.SetAuthor( '' )
168 EndOfInitLoopSwitch.SetComment( 'Compute Node' )
169 EndOfInitLoopSwitch.Coords( 1074 , 194 )
170 PyEndOfInitLoopSwitch = []
171 PyEndOfInitLoopSwitch.append( 'from time import * ' )
172 PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' )
173 PyEndOfInitLoopSwitch.append( ' sleep(1) ' )
174 PyEndOfInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
175 EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch )
176 IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
177 IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
178 IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
179 IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
180 IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
181 OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
182 OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
183 OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
184 OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
185 IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
186 IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
187 IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
188 IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
189 IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
190 OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
191 OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
192 OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
193 OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
194 OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
195 InitLoopSwitch.SetName( 'InitLoopSwitch' )
196 InitLoopSwitch.SetAuthor( '' )
197 InitLoopSwitch.SetComment( 'Compute Node' )
198 InitLoopSwitch.Coords( 10 , 129 )
200 # Creation of Switch Nodes
202 PySwitch.append( 'from time import * ' )
203 PySwitch.append( 'def Switch(a) : ' )
204 PySwitch.append( ' sleep(1) ' )
205 PySwitch.append( ' Branch = "Negative or null" ' )
206 PySwitch.append( ' if a <= 0 : ' )
207 PySwitch.append( ' return 0,0,a,Branch,1 ' )
208 PySwitch.append( ' if ( a & 1 ) == 0 : ' )
209 PySwitch.append( ' Branch = "Even" ' )
210 PySwitch.append( ' else : ' )
211 PySwitch.append( ' Branch = "Odd" ' )
212 PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' )
213 Switch,EndOfSwitch = GraphSwitchCheckDefault2NOTValid.SNode( 'Switch' , PySwitch )
214 EndOfSwitch.SetName( 'EndOfSwitch' )
215 EndOfSwitch.SetAuthor( '' )
216 EndOfSwitch.SetComment( 'Compute Node' )
217 EndOfSwitch.Coords( 882 , 194 )
219 PyEndOfSwitch.append( 'from time import * ' )
220 PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' )
221 PyEndOfSwitch.append( ' sleep(1) ' )
222 PyEndOfSwitch.append( ' return a ' )
223 EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch )
224 IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
225 IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' )
226 IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
227 OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
228 OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
229 Switch.SetName( 'Switch' )
230 Switch.SetAuthor( '' )
231 Switch.SetComment( 'Compute Node' )
232 Switch.Coords( 190 , 129 )
233 ISwitcha = Switch.InPort( 'a' , 'long' )
234 ISwitchGate = Switch.GetInPort( 'Gate' )
235 OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
236 OSwitchEven = Switch.OutPort( 'Even' , 'int' )
237 OSwitcha = Switch.OutPort( 'a' , 'int' )
238 OSwitchBranch = Switch.OutPort( 'Branch' , 'string' )
239 OSwitchdefault = Switch.OutPort( 'default' , 'boolean' )
240 OSwitchDefault = Switch.GetOutPort( 'Default' )
243 LIsOddaEmptyNodea = GraphSwitchCheckDefault2NOTValid.Link( OIsOdda , IEmptyNodea )
244 LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 )
246 LIsEvenaEndOfSwitcha = GraphSwitchCheckDefault2NOTValid.Link( OIsEvena , IEndOfSwitcha )
248 LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault2NOTValid.Link( OPrintOddBranch , IEmptyNodeBranch )
250 LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheckDefault2NOTValid.Link( OPrintEvenBranch , IEndOfSwitchBranch )
252 LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault2NOTValid.Link( OEmptyNodea , IEndOfSwitcha )
254 LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault2NOTValid.Link( OEmptyNodeBranch , IEndOfSwitchBranch )
256 LDefaultaEndOfSwitcha = GraphSwitchCheckDefault2NOTValid.Link( ODefaulta , IEndOfSwitcha )
258 LDefaultaPutaa = GraphSwitchCheckDefault2NOTValid.Link( ODefaulta , IPutaa )
260 LDefaultBranchEndOfSwitchBranch = GraphSwitchCheckDefault2NOTValid.Link( ODefaultBranch , IEndOfSwitchBranch )
262 LDefaultBranchPutBranchBranch = GraphSwitchCheckDefault2NOTValid.Link( ODefaultBranch , IPutBranchBranch )
264 LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault2NOTValid.Link( OInitLoopSwitchIndex , ISwitcha )
266 LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault2NOTValid.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
268 LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault2NOTValid.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
270 LSwitchOddIsOddGate = GraphSwitchCheckDefault2NOTValid.Link( OSwitchOdd , IIsOddGate )
271 LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 )
272 LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 )
274 LSwitchOddPrintOddGate = GraphSwitchCheckDefault2NOTValid.Link( OSwitchOdd , IPrintOddGate )
275 LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 )
276 LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 )
278 LSwitchEvenIsEvenGate = GraphSwitchCheckDefault2NOTValid.Link( OSwitchEven , IIsEvenGate )
279 LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 )
280 LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 )
282 LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault2NOTValid.Link( OSwitchEven , IPrintEvenGate )
283 LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 )
284 LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 )
286 LSwitchaIsOdda = GraphSwitchCheckDefault2NOTValid.Link( OSwitcha , IIsOdda )
287 LSwitchaIsOdda.AddCoord( 1 , 382 , 78 )
288 LSwitchaIsOdda.AddCoord( 2 , 382 , 199 )
290 LSwitchaIsEvena = GraphSwitchCheckDefault2NOTValid.Link( OSwitcha , IIsEvena )
291 LSwitchaIsEvena.AddCoord( 1 , 381 , 509 )
292 LSwitchaIsEvena.AddCoord( 2 , 382 , 200 )
294 LSwitchaPrintOdda = GraphSwitchCheckDefault2NOTValid.Link( OSwitcha , IPrintOdda )
296 LSwitchaPrintEvena = GraphSwitchCheckDefault2NOTValid.Link( OSwitcha , IPrintEvena )
297 LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 )
298 LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 )
300 LSwitchaDefaulta = GraphSwitchCheckDefault2NOTValid.Link( OSwitcha , IDefaulta )
301 LSwitchaDefaulta.AddCoord( 1 , 382 , 663 )
302 LSwitchaDefaulta.AddCoord( 2 , 382 , 199 )
304 LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault2NOTValid.Link( OSwitchBranch , IPrintOddBranch )
306 LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault2NOTValid.Link( OSwitchBranch , IPrintEvenBranch )
307 LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 )
308 LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 )
310 LSwitchBranchDefaultBranch = GraphSwitchCheckDefault2NOTValid.Link( OSwitchBranch , IDefaultBranch )
311 LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 )
312 LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 )
314 LSwitchdefaultDefaultGate = GraphSwitchCheckDefault2NOTValid.Link( OSwitchdefault , IDefaultGate )
315 LSwitchdefaultDefaultGate.AddCoord( 1 , 363 , 707 )
316 LSwitchdefaultDefaultGate.AddCoord( 2 , 362 , 239 )
318 LSwitchDefaultEndOfSwitchDefault = GraphSwitchCheckDefault2NOTValid.Link( OSwitchDefault , IEndOfSwitchDefault )
320 LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault2NOTValid.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
322 LPutaaEndOfSwitcha = GraphSwitchCheckDefault2NOTValid.Link( OPutaa , IEndOfSwitcha )
324 LPutBranchBranchEndOfSwitchBranch = GraphSwitchCheckDefault2NOTValid.Link( OPutBranchBranch , IEndOfSwitchBranch )
327 IInitLoopSwitchIndex.Input( 0 )
328 IInitLoopSwitchMin.Input( -5 )
329 IInitLoopSwitchMax.Input( 10 )
331 # Output Ports of the graph
332 #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
333 #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
334 #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
335 return GraphSwitchCheckDefault2NOTValid
338 GraphSwitchCheckDefault2NOTValid = DefGraphSwitchCheckDefault2NOTValid()