2 # Generated python file of Graph GraphSwitchs_1
6 # Graph creation of GraphSwitchs_1
7 def DefGraphSwitchs_1() :
8 GraphSwitchs_1 = Graph( 'GraphSwitchs_1' )
9 GraphSwitchs_1.SetName( 'GraphSwitchs_1' )
10 GraphSwitchs_1.SetAuthor( '' )
11 GraphSwitchs_1.SetComment( '' )
12 GraphSwitchs_1.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 (GraphSwitchs)" ' )
21 PyIsOdd.append( ' sleep( 1 ) ' )
22 PyIsOdd.append( ' return a ' )
23 IsOdd = GraphSwitchs_1.INode( 'IsOdd' , PyIsOdd )
24 IsOdd.SetName( 'IsOdd' )
26 IsOdd.SetComment( 'Python function' )
27 IsOdd.Coords( 388 , 50 )
28 IIsOdda = IsOdd.InPort( 'a' , 'long' )
29 IIsOddGate = IsOdd.GetInPort( 'Gate' )
30 OIsOdda = IsOdd.OutPort( 'a' , 'long' )
31 OIsOddGate = IsOdd.GetOutPort( 'Gate' )
34 PyIsOdd_1.append( 'from time import * ' )
35 PyIsOdd_1.append( 'def IsOdd(a) : ' )
36 PyIsOdd_1.append( ' print a,"IsOdd_1 (GraphSwitchs)" ' )
37 PyIsOdd_1.append( ' sleep( 1 ) ' )
38 PyIsOdd_1.append( ' return a ' )
39 IsOdd_1 = GraphSwitchs_1.INode( 'IsOdd' , PyIsOdd_1 )
40 IsOdd_1.SetName( 'IsOdd_1' )
41 IsOdd_1.SetAuthor( '' )
42 IsOdd_1.SetComment( 'Python function' )
43 IsOdd_1.Coords( 419 , 308 )
44 IIsOdd_1a = IsOdd_1.InPort( 'a' , 'long' )
45 IIsOdd_1Gate = IsOdd_1.GetInPort( 'Gate' )
46 OIsOdd_1a = IsOdd_1.OutPort( 'a' , 'long' )
47 OIsOdd_1Gate = IsOdd_1.GetOutPort( 'Gate' )
49 # Creation of Loop Nodes
51 PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
52 PyInitLoopSwitch.append( ' return Index,Min,Max ' )
53 PyMoreInitLoopSwitch = []
54 PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
55 PyMoreInitLoopSwitch.append( ' if Index <= Max : ' )
56 PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' )
57 PyMoreInitLoopSwitch.append( ' else : ' )
58 PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' )
59 PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
60 PyNextInitLoopSwitch = []
61 PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
62 PyNextInitLoopSwitch.append( ' Index = Index + 1 ' )
63 PyNextInitLoopSwitch.append( ' return Index,Min,Max ' )
64 InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchs_1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
65 EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
66 EndOfInitLoopSwitch.SetAuthor( '' )
67 EndOfInitLoopSwitch.SetComment( 'Compute Node' )
68 EndOfInitLoopSwitch.Coords( 766 , 127 )
69 PyEndOfInitLoopSwitch = []
70 EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch )
71 IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
72 IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
73 IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
74 IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
75 IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
76 OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
77 OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
78 OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
79 OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
80 OInitLoopSwitchGate = InitLoopSwitch.GetOutPort( 'Gate' )
81 IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
82 IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
83 IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
84 IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
85 IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
86 OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
87 OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
88 OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
89 OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
90 OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
91 InitLoopSwitch.SetName( 'InitLoopSwitch' )
92 InitLoopSwitch.SetAuthor( '' )
93 InitLoopSwitch.SetComment( 'Compute Node' )
94 InitLoopSwitch.Coords( 10 , 129 )
97 PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' )
98 PyInitLoop.append( ' return Index,Min,Max ' )
100 PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' )
101 PyMoreInitLoop.append( ' if Index <= Max : ' )
102 PyMoreInitLoop.append( ' DoLoop = 1 ' )
103 PyMoreInitLoop.append( ' else : ' )
104 PyMoreInitLoop.append( ' DoLoop = 0 ' )
105 PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' )
107 PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' )
108 PyNextInitLoop.append( ' Index = Index + 1 ' )
109 PyNextInitLoop.append( ' return Index,Min,Max ' )
110 InitLoop,EndOfInitLoop = GraphSwitchs_1.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop )
111 EndOfInitLoop.SetName( 'EndOfInitLoop' )
112 EndOfInitLoop.SetAuthor( '' )
113 EndOfInitLoop.SetComment( 'Compute Node' )
114 EndOfInitLoop.Coords( 783 , 381 )
116 EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop )
117 IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
118 IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
119 IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
120 IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
121 IInitLoopGate = InitLoop.GetInPort( 'Gate' )
122 OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
123 OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
124 OInitLoopMin = InitLoop.GetOutPort( 'Min' )
125 OInitLoopMax = InitLoop.GetOutPort( 'Max' )
126 OInitLoopGate = InitLoop.GetOutPort( 'Gate' )
127 IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
128 IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
129 IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
130 IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
131 IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
132 OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
133 OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
134 OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
135 OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
136 OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' )
137 InitLoop.SetName( 'InitLoop' )
138 InitLoop.SetAuthor( '' )
139 InitLoop.SetComment( 'Compute Node' )
140 InitLoop.Coords( 10 , 388 )
142 # Creation of Switch Nodes
144 PySwitch.append( 'from time import * ' )
145 PySwitch.append( 'def Switch(a) : ' )
146 PySwitch.append( ' if ( a & 1 ) == 0 : ' )
147 PySwitch.append( ' sleep(1) ' )
148 PySwitch.append( ' return a & 1,1-(a&1),a ' )
149 Switch,EndOfSwitch = GraphSwitchs_1.SNode( 'Switch' , PySwitch )
150 EndOfSwitch.SetName( 'EndOfSwitch' )
151 EndOfSwitch.SetAuthor( '' )
152 EndOfSwitch.SetComment( 'Compute Node' )
153 EndOfSwitch.Coords( 587 , 126 )
155 EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch )
156 IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
157 IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
158 OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
159 OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
160 Switch.SetName( 'Switch' )
161 Switch.SetAuthor( '' )
162 Switch.SetComment( 'Compute Node' )
163 Switch.Coords( 186 , 130 )
164 ISwitcha = Switch.InPort( 'a' , 'long' )
165 ISwitchGate = Switch.GetInPort( 'Gate' )
166 OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
167 OSwitchEven = Switch.OutPort( 'Even' , 'int' )
168 OSwitcha = Switch.OutPort( 'a' , 'int' )
169 OSwitchDefault = Switch.GetOutPort( 'Default' )
172 PySwitch_1.append( 'from time import * ' )
173 PySwitch_1.append( 'def Switch(a) : ' )
174 PySwitch_1.append( ' if ( a & 1 ) == 0 : ' )
175 PySwitch_1.append( ' sleep(1) ' )
176 PySwitch_1.append( ' return a & 1,1-(a&1),a ' )
177 Switch_1,EndSwitch = GraphSwitchs_1.SNode( 'Switch' , PySwitch_1 )
178 EndSwitch.SetName( 'EndSwitch' )
179 EndSwitch.SetAuthor( '' )
180 EndSwitch.SetComment( 'Compute Node' )
181 EndSwitch.Coords( 605 , 382 )
183 EndSwitch.SetPyFunction( '' , PyEndSwitch )
184 IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
185 IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
186 OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
187 OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
188 Switch_1.SetName( 'Switch_1' )
189 Switch_1.SetAuthor( '' )
190 Switch_1.SetComment( 'Compute Node' )
191 Switch_1.Coords( 193 , 388 )
192 ISwitch_1a = Switch_1.InPort( 'a' , 'long' )
193 ISwitch_1Gate = Switch_1.GetInPort( 'Gate' )
194 OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' )
195 OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' )
196 OSwitch_1a = Switch_1.OutPort( 'a' , 'int' )
197 OSwitch_1Default = Switch_1.GetOutPort( 'Default' )
200 LIsOddaEndOfSwitcha = GraphSwitchs_1.Link( OIsOdda , IEndOfSwitcha )
201 LIsOddaEndOfSwitcha.AddCoord( 1 , 573 , 160 )
202 LIsOddaEndOfSwitcha.AddCoord( 2 , 572 , 130 )
204 LInitLoopSwitchIndexSwitcha = GraphSwitchs_1.Link( OInitLoopSwitchIndex , ISwitcha )
206 LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchs_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
208 LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchs_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
210 LSwitchOddIsOddGate = GraphSwitchs_1.Link( OSwitchOdd , IIsOddGate )
212 LSwitchaIsOdda = GraphSwitchs_1.Link( OSwitcha , IIsOdda )
213 LSwitchaIsOdda.AddCoord( 1 , 365 , 129 )
214 LSwitchaIsOdda.AddCoord( 2 , 365 , 222 )
216 LSwitchDefaultEndOfSwitchDefault = GraphSwitchs_1.Link( OSwitchDefault , IEndOfSwitchDefault )
217 LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 572 , 194 )
218 LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 571 , 257 )
220 LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchs_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
222 LIsOdd_1aEndSwitcha = GraphSwitchs_1.Link( OIsOdd_1a , IEndSwitcha )
223 LIsOdd_1aEndSwitcha.AddCoord( 1 , 599 , 416 )
224 LIsOdd_1aEndSwitcha.AddCoord( 2 , 598 , 389 )
226 LInitLoopIndexSwitch_1a = GraphSwitchs_1.Link( OInitLoopIndex , ISwitch_1a )
228 LInitLoopMinEndOfInitLoopMin = GraphSwitchs_1.Link( OInitLoopMin , IEndOfInitLoopMin )
230 LInitLoopMaxEndOfInitLoopMax = GraphSwitchs_1.Link( OInitLoopMax , IEndOfInitLoopMax )
232 LSwitch_1OddIsOdd_1Gate = GraphSwitchs_1.Link( OSwitch_1Odd , IIsOdd_1Gate )
234 LSwitch_1EvenEndSwitchDefault = GraphSwitchs_1.Link( OSwitch_1Even , IEndSwitchDefault )
236 LSwitch_1aIsOdd_1a = GraphSwitchs_1.Link( OSwitch_1a , IIsOdd_1a )
237 LSwitch_1aIsOdd_1a.AddCoord( 1 , 379 , 387 )
238 LSwitch_1aIsOdd_1a.AddCoord( 2 , 378 , 481 )
240 LEndSwitchaEndOfInitLoopIndex = GraphSwitchs_1.Link( OEndSwitcha , IEndOfInitLoopIndex )
243 IInitLoopSwitchIndex.Input( 0 )
244 IInitLoopSwitchMin.Input( 0 )
245 IInitLoopSwitchMax.Input( 20 )
246 IInitLoopIndex.Input( 0 )
247 IInitLoopMin.Input( 0 )
248 IInitLoopMax.Input( 20 )
250 # Output Ports of the graph
251 #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
252 #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
253 #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
254 #OSwitchEven = Switch.GetOutPort( 'Even' )
255 #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
256 #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
257 #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
258 return GraphSwitchs_1
261 GraphSwitchs_1 = DefGraphSwitchs_1()