2 # Generated python file of Graph GraphSwitchCheckDefault2NOTValid1
6 # Graph creation of GraphSwitchCheckDefault2NOTValid1
7 def DefGraphSwitchCheckDefault2NOTValid1() :
8 GraphSwitchCheckDefault2NOTValid1 = Graph( 'GraphSwitchCheckDefault2NOTValid1' )
9 GraphSwitchCheckDefault2NOTValid1.SetName( 'GraphSwitchCheckDefault2NOTValid1' )
10 GraphSwitchCheckDefault2NOTValid1.SetAuthor( 'JR' )
11 GraphSwitchCheckDefault2NOTValid1.SetComment( '' )
12 GraphSwitchCheckDefault2NOTValid1.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 = GraphSwitchCheckDefault2NOTValid1.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 = GraphSwitchCheckDefault2NOTValid1.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 = GraphSwitchCheckDefault2NOTValid1.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 = GraphSwitchCheckDefault2NOTValid1.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 = GraphSwitchCheckDefault2NOTValid1.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 = GraphSwitchCheckDefault2NOTValid1.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' )
117 # Creation of Loop Nodes
118 PyInitLoopSwitch = []
119 PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
120 PyInitLoopSwitch.append( ' Index = Max ' )
121 PyInitLoopSwitch.append( ' return Index,Min,Max ' )
122 PyMoreInitLoopSwitch = []
123 PyMoreInitLoopSwitch.append( 'from time import * ' )
124 PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
125 PyMoreInitLoopSwitch.append( ' sleep(1) ' )
126 PyMoreInitLoopSwitch.append( ' if Index >= Min : ' )
127 PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' )
128 PyMoreInitLoopSwitch.append( ' else : ' )
129 PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' )
130 PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
131 PyNextInitLoopSwitch = []
132 PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
133 PyNextInitLoopSwitch.append( ' Index = Index - 1 ' )
134 PyNextInitLoopSwitch.append( ' return Index,Min,Max ' )
135 InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckDefault2NOTValid1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
136 EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
137 EndOfInitLoopSwitch.SetAuthor( '' )
138 EndOfInitLoopSwitch.SetComment( 'Compute Node' )
139 EndOfInitLoopSwitch.Coords( 1074 , 194 )
140 PyEndOfInitLoopSwitch = []
141 PyEndOfInitLoopSwitch.append( 'from time import * ' )
142 PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' )
143 PyEndOfInitLoopSwitch.append( ' sleep(1) ' )
144 PyEndOfInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
145 EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch )
146 IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
147 IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
148 IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
149 IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
150 IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
151 OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
152 OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
153 OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
154 OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
155 IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
156 IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
157 IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
158 IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
159 IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
160 OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
161 OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
162 OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
163 OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
164 OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
165 InitLoopSwitch.SetName( 'InitLoopSwitch' )
166 InitLoopSwitch.SetAuthor( '' )
167 InitLoopSwitch.SetComment( 'Compute Node' )
168 InitLoopSwitch.Coords( 10 , 129 )
170 # Creation of Switch Nodes
172 PySwitch.append( 'from time import * ' )
173 PySwitch.append( 'def Switch(a) : ' )
174 PySwitch.append( ' sleep(1) ' )
175 PySwitch.append( ' Branch = "Negative or null" ' )
176 PySwitch.append( ' if a <= 0 : ' )
177 PySwitch.append( ' return 0,0,a,Branch,1 ' )
178 PySwitch.append( ' if ( a & 1 ) == 0 : ' )
179 PySwitch.append( ' Branch = "Even" ' )
180 PySwitch.append( ' else : ' )
181 PySwitch.append( ' Branch = "Odd" ' )
182 PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' )
183 Switch,EndOfSwitch = GraphSwitchCheckDefault2NOTValid1.SNode( 'Switch' , PySwitch )
184 EndOfSwitch.SetName( 'EndOfSwitch' )
185 EndOfSwitch.SetAuthor( '' )
186 EndOfSwitch.SetComment( 'Compute Node' )
187 EndOfSwitch.Coords( 882 , 194 )
189 PyEndOfSwitch.append( 'from time import * ' )
190 PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' )
191 PyEndOfSwitch.append( ' sleep(1) ' )
192 PyEndOfSwitch.append( ' return a ' )
193 EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch )
194 IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
195 IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' )
196 IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
197 OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
198 OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
199 Switch.SetName( 'Switch' )
200 Switch.SetAuthor( '' )
201 Switch.SetComment( 'Compute Node' )
202 Switch.Coords( 190 , 129 )
203 ISwitcha = Switch.InPort( 'a' , 'long' )
204 ISwitchGate = Switch.GetInPort( 'Gate' )
205 OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
206 OSwitchEven = Switch.OutPort( 'Even' , 'int' )
207 OSwitcha = Switch.OutPort( 'a' , 'int' )
208 OSwitchBranch = Switch.OutPort( 'Branch' , 'string' )
209 OSwitchdefault = Switch.OutPort( 'default' , 'boolean' )
210 OSwitchDefault = Switch.GetOutPort( 'Default' )
213 LIsOddaEmptyNodea = GraphSwitchCheckDefault2NOTValid1.Link( OIsOdda , IEmptyNodea )
214 LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 )
216 LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault2NOTValid1.Link( OPrintOddBranch , IEmptyNodeBranch )
218 LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault2NOTValid1.Link( OEmptyNodea , IEndOfSwitcha )
220 LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault2NOTValid1.Link( OEmptyNodeBranch , IEndOfSwitchBranch )
222 LDefaultGateEmptyNodeGate = GraphSwitchCheckDefault2NOTValid1.Link( ODefaultGate , IEmptyNodeGate )
224 LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault2NOTValid1.Link( OInitLoopSwitchIndex , ISwitcha )
226 LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault2NOTValid1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
228 LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault2NOTValid1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
230 LSwitchOddIsOddGate = GraphSwitchCheckDefault2NOTValid1.Link( OSwitchOdd , IIsOddGate )
231 LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 )
232 LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 )
234 LSwitchOddPrintOddGate = GraphSwitchCheckDefault2NOTValid1.Link( OSwitchOdd , IPrintOddGate )
235 LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 )
236 LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 )
238 LSwitchEvenIsEvenGate = GraphSwitchCheckDefault2NOTValid1.Link( OSwitchEven , IIsEvenGate )
239 LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 )
240 LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 )
242 LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault2NOTValid1.Link( OSwitchEven , IPrintEvenGate )
243 LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 )
244 LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 )
246 LSwitchaIsOdda = GraphSwitchCheckDefault2NOTValid1.Link( OSwitcha , IIsOdda )
247 LSwitchaIsOdda.AddCoord( 1 , 382 , 78 )
248 LSwitchaIsOdda.AddCoord( 2 , 382 , 199 )
250 LSwitchaIsEvena = GraphSwitchCheckDefault2NOTValid1.Link( OSwitcha , IIsEvena )
251 LSwitchaIsEvena.AddCoord( 1 , 381 , 509 )
252 LSwitchaIsEvena.AddCoord( 2 , 382 , 200 )
254 LSwitchaPrintOdda = GraphSwitchCheckDefault2NOTValid1.Link( OSwitcha , IPrintOdda )
256 LSwitchaPrintEvena = GraphSwitchCheckDefault2NOTValid1.Link( OSwitcha , IPrintEvena )
257 LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 )
258 LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 )
260 LSwitchaDefaulta = GraphSwitchCheckDefault2NOTValid1.Link( OSwitcha , IDefaulta )
261 LSwitchaDefaulta.AddCoord( 1 , 382 , 663 )
262 LSwitchaDefaulta.AddCoord( 2 , 382 , 199 )
264 LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault2NOTValid1.Link( OSwitchBranch , IPrintOddBranch )
266 LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault2NOTValid1.Link( OSwitchBranch , IPrintEvenBranch )
267 LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 )
268 LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 )
270 LSwitchBranchDefaultBranch = GraphSwitchCheckDefault2NOTValid1.Link( OSwitchBranch , IDefaultBranch )
271 LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 )
272 LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 )
274 LSwitchdefaultDefaultGate = GraphSwitchCheckDefault2NOTValid1.Link( OSwitchdefault , IDefaultGate )
275 LSwitchdefaultDefaultGate.AddCoord( 1 , 363 , 707 )
276 LSwitchdefaultDefaultGate.AddCoord( 2 , 362 , 239 )
278 LSwitchDefaultEndOfSwitchDefault = GraphSwitchCheckDefault2NOTValid1.Link( OSwitchDefault , IEndOfSwitchDefault )
280 LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault2NOTValid1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
283 IInitLoopSwitchIndex.Input( 0 )
284 IInitLoopSwitchMin.Input( -5 )
285 IInitLoopSwitchMax.Input( 10 )
287 # Output Ports of the graph
288 #OIsEvena = IsEven.GetOutPort( 'a' )
289 #OPrintEvenBranch = PrintEven.GetOutPort( 'Branch' )
290 #ODefaulta = Default.GetOutPort( 'a' )
291 #ODefaultBranch = Default.GetOutPort( 'Branch' )
292 #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
293 #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
294 #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
295 return GraphSwitchCheckDefault2NOTValid1
298 GraphSwitchCheckDefault2NOTValid1 = DefGraphSwitchCheckDefault2NOTValid1()