2 # Generated python file of Graph GraphLoopSwitchOfSwitchNOTValid
6 # Graph creation of GraphLoopSwitchOfSwitchNOTValid
7 def DefGraphLoopSwitchOfSwitchNOTValid() :
8 GraphLoopSwitchOfSwitchNOTValid = Graph( 'GraphLoopSwitchOfSwitchNOTValid' )
9 GraphLoopSwitchOfSwitchNOTValid.SetName( 'GraphLoopSwitchOfSwitchNOTValid' )
10 GraphLoopSwitchOfSwitchNOTValid.SetAuthor( 'JR' )
11 GraphLoopSwitchOfSwitchNOTValid.SetComment( '' )
12 GraphLoopSwitchOfSwitchNOTValid.Coords( 0 , 0 )
14 # Creation of Factory Nodes
16 # Creation of InLine Nodes
18 PyIsEven.append( 'from time import * ' )
19 PyIsEven.append( 'def IsEven(a) : ' )
20 PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' )
21 PyIsEven.append( ' sleep( 1 ) ' )
22 PyIsEven.append( ' return a ' )
23 IsEven = GraphLoopSwitchOfSwitchNOTValid.INode( 'IsEven' , PyIsEven )
24 IsEven.SetName( 'IsEven' )
25 IsEven.SetAuthor( '' )
26 IsEven.SetComment( 'Compute Node' )
27 IsEven.Coords( 437 , 520 )
28 IIsEvena = IsEven.InPort( 'a' , 'long' )
29 IIsEvenGate = IsEven.GetInPort( 'Gate' )
30 OIsEvena = IsEven.OutPort( 'a' , 'long' )
31 OIsEvenGate = IsEven.GetOutPort( 'Gate' )
34 PyPseudoPOne.append( 'from time import * ' )
35 PyPseudoPOne.append( 'def PseudoPOne(POne) : ' )
36 PyPseudoPOne.append( ' sleep(1) ' )
37 PyPseudoPOne.append( ' return 6*POne+1 ' )
38 PseudoPOne = GraphLoopSwitchOfSwitchNOTValid.INode( 'PseudoPOne' , PyPseudoPOne )
39 PseudoPOne.SetName( 'PseudoPOne' )
40 PseudoPOne.SetAuthor( '' )
41 PseudoPOne.SetComment( 'Compute Node' )
42 PseudoPOne.Coords( 612 , 5 )
43 IPseudoPOnePOne = PseudoPOne.InPort( 'POne' , 'long' )
44 IPseudoPOneGate = PseudoPOne.GetInPort( 'Gate' )
45 OPseudoPOnea = PseudoPOne.OutPort( 'a' , 'long' )
46 OPseudoPOneGate = PseudoPOne.GetOutPort( 'Gate' )
49 PyPseudoPThree.append( 'from time import * ' )
50 PyPseudoPThree.append( 'def PseudoPThree_1(PThree) : ' )
51 PyPseudoPThree.append( ' sleep(1) ' )
52 PyPseudoPThree.append( ' return 6*PThree+3 ' )
53 PseudoPThree = GraphLoopSwitchOfSwitchNOTValid.INode( 'PseudoPThree_1' , PyPseudoPThree )
54 PseudoPThree.SetName( 'PseudoPThree' )
55 PseudoPThree.SetAuthor( '' )
56 PseudoPThree.SetComment( 'Compute Node' )
57 PseudoPThree.Coords( 620 , 149 )
58 IPseudoPThreePThree = PseudoPThree.InPort( 'PThree' , 'long' )
59 IPseudoPThreeGate = PseudoPThree.GetInPort( 'Gate' )
60 OPseudoPThreea = PseudoPThree.OutPort( 'a' , 'long' )
61 OPseudoPThreeGate = PseudoPThree.GetOutPort( 'Gate' )
64 PyPseudoPFive.append( 'from time import * ' )
65 PyPseudoPFive.append( 'def PseudoPFive(PFive) : ' )
66 PyPseudoPFive.append( ' sleep(1) ' )
67 PyPseudoPFive.append( ' return 6*PFive+5 ' )
68 PseudoPFive = GraphLoopSwitchOfSwitchNOTValid.INode( 'PseudoPFive' , PyPseudoPFive )
69 PseudoPFive.SetName( 'PseudoPFive' )
70 PseudoPFive.SetAuthor( '' )
71 PseudoPFive.SetComment( 'Compute Node' )
72 PseudoPFive.Coords( 625 , 343 )
73 IPseudoPFivePFive = PseudoPFive.InPort( 'PFive' , 'long' )
74 IPseudoPFiveGate = PseudoPFive.GetInPort( 'Gate' )
75 OPseudoPFivea = PseudoPFive.OutPort( 'a' , 'long' )
76 OPseudoPFiveGate = PseudoPFive.GetOutPort( 'Gate' )
78 # Creation of Loop Nodes
80 PyLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
81 PyLoopSwitch.append( ' Index = Max ' )
82 PyLoopSwitch.append( ' return Index,Min,Max ' )
84 PyMoreLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
85 PyMoreLoopSwitch.append( ' if Index >= Min : ' )
86 PyMoreLoopSwitch.append( ' DoLoop = 1 ' )
87 PyMoreLoopSwitch.append( ' else : ' )
88 PyMoreLoopSwitch.append( ' DoLoop = 0 ' )
89 PyMoreLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
91 PyNextLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
92 PyNextLoopSwitch.append( ' Index = Index - 1 ' )
93 PyNextLoopSwitch.append( ' return Index,Min,Max ' )
94 LoopSwitch,EndOfLoopSwitch = GraphLoopSwitchOfSwitchNOTValid.LNode( 'InitLoop' , PyLoopSwitch , 'MoreLoop' , PyMoreLoopSwitch , 'NextLoop' , PyNextLoopSwitch )
95 EndOfLoopSwitch.SetName( 'EndOfLoopSwitch' )
96 EndOfLoopSwitch.SetAuthor( '' )
97 EndOfLoopSwitch.SetComment( 'Compute Node' )
98 EndOfLoopSwitch.Coords( 1268 , 210 )
99 PyEndOfLoopSwitch = []
100 EndOfLoopSwitch.SetPyFunction( '' , PyEndOfLoopSwitch )
101 ILoopSwitchDoLoop = LoopSwitch.GetInPort( 'DoLoop' )
102 ILoopSwitchIndex = LoopSwitch.InPort( 'Index' , 'long' )
103 ILoopSwitchMin = LoopSwitch.InPort( 'Min' , 'long' )
104 ILoopSwitchMax = LoopSwitch.InPort( 'Max' , 'long' )
105 ILoopSwitchGate = LoopSwitch.GetInPort( 'Gate' )
106 OLoopSwitchDoLoop = LoopSwitch.GetOutPort( 'DoLoop' )
107 OLoopSwitchIndex = LoopSwitch.GetOutPort( 'Index' )
108 OLoopSwitchMin = LoopSwitch.GetOutPort( 'Min' )
109 OLoopSwitchMax = LoopSwitch.GetOutPort( 'Max' )
110 IEndOfLoopSwitchDoLoop = EndOfLoopSwitch.GetInPort( 'DoLoop' )
111 IEndOfLoopSwitchIndex = EndOfLoopSwitch.GetInPort( 'Index' )
112 IEndOfLoopSwitchMin = EndOfLoopSwitch.GetInPort( 'Min' )
113 IEndOfLoopSwitchMax = EndOfLoopSwitch.GetInPort( 'Max' )
114 IEndOfLoopSwitchGate = EndOfLoopSwitch.GetInPort( 'Gate' )
115 OEndOfLoopSwitchDoLoop = EndOfLoopSwitch.GetOutPort( 'DoLoop' )
116 OEndOfLoopSwitchIndex = EndOfLoopSwitch.GetOutPort( 'Index' )
117 OEndOfLoopSwitchMin = EndOfLoopSwitch.GetOutPort( 'Min' )
118 OEndOfLoopSwitchMax = EndOfLoopSwitch.GetOutPort( 'Max' )
119 OEndOfLoopSwitchGate = EndOfLoopSwitch.GetOutPort( 'Gate' )
120 LoopSwitch.SetName( 'LoopSwitch' )
121 LoopSwitch.SetAuthor( '' )
122 LoopSwitch.SetComment( 'Compute Node' )
123 LoopSwitch.Coords( 6 , 233 )
125 # Creation of Switch Nodes
127 PySwitch.append( 'from time import * ' )
128 PySwitch.append( 'def Switch(a) : ' )
129 PySwitch.append( ' sleep(1) ' )
130 PySwitch.append( ' if a <= 0 : ' )
131 PySwitch.append( ' return 0,a,0 ' )
132 PySwitch.append( ' return a & 1,a,1-(a&1) ' )
133 Switch,EndOfSwitch = GraphLoopSwitchOfSwitchNOTValid.SNode( 'Switch' , PySwitch )
134 EndOfSwitch.SetName( 'EndOfSwitch' )
135 EndOfSwitch.SetAuthor( '' )
136 EndOfSwitch.SetComment( 'Compute Node' )
137 EndOfSwitch.Coords( 1075 , 210 )
139 EndOfSwitch.SetPyFunction( 'EndSwitch_1' , PyEndOfSwitch )
140 IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
141 IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
142 OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
143 OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
144 Switch.SetName( 'Switch' )
145 Switch.SetAuthor( '' )
146 Switch.SetComment( 'Compute Node' )
147 Switch.Coords( 201 , 233 )
148 ISwitcha = Switch.InPort( 'a' , 'long' )
149 ISwitchGate = Switch.GetInPort( 'Gate' )
150 OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
151 OSwitcha = Switch.OutPort( 'a' , 'int' )
152 OSwitchEven = Switch.OutPort( 'Even' , 'boolean' )
153 OSwitchDefault = Switch.GetOutPort( 'Default' )
156 PySwitchOdd.append( 'def SwitchOdd(a) : ' )
157 PySwitchOdd.append( ' n = a/6 ' )
158 PySwitchOdd.append( ' r = a%6 ' )
159 PySwitchOdd.append( ' POne = 0 ' )
160 PySwitchOdd.append( ' PThree = 0 ' )
161 PySwitchOdd.append( ' PFive = 0 ' )
162 PySwitchOdd.append( ' if r == 1 : ' )
163 PySwitchOdd.append( ' POne = 1 ' )
164 PySwitchOdd.append( ' if r == 3 : ' )
165 PySwitchOdd.append( ' PThree = 1 ' )
166 PySwitchOdd.append( ' if r == 5 : ' )
167 PySwitchOdd.append( ' PFive = 1 ' )
168 PySwitchOdd.append( ' return POne,PThree,PFive,n ' )
169 SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchOfSwitchNOTValid.SNode( 'SwitchOdd' , PySwitchOdd )
170 EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' )
171 EndOfSwitchOdd.SetAuthor( '' )
172 EndOfSwitchOdd.SetComment( 'Compute Node' )
173 EndOfSwitchOdd.Coords( 851 , 210 )
174 PyEndOfSwitchOdd = []
175 EndOfSwitchOdd.SetPyFunction( 'EndSwitch' , PyEndOfSwitchOdd )
176 IEndOfSwitchOddn = EndOfSwitchOdd.InPort( 'n' , 'long' )
177 IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' )
178 OEndOfSwitchOddn = EndOfSwitchOdd.OutPort( 'n' , 'long' )
179 OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' )
180 SwitchOdd.SetName( 'SwitchOdd' )
181 SwitchOdd.SetAuthor( '' )
182 SwitchOdd.SetComment( 'Compute Node' )
183 SwitchOdd.Coords( 412 , 169 )
184 ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' )
185 ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' )
186 OSwitchOddPOne = SwitchOdd.OutPort( 'POne' , 'boolean' )
187 OSwitchOddPThree = SwitchOdd.OutPort( 'PThree' , 'boolean' )
188 OSwitchOddPFive = SwitchOdd.OutPort( 'PFive' , 'boolean' )
189 OSwitchOddn = SwitchOdd.OutPort( 'n' , 'long' )
190 OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' )
193 LLoopSwitchIndexSwitcha = GraphLoopSwitchOfSwitchNOTValid.Link( OLoopSwitchIndex , ISwitcha )
195 LLoopSwitchMinEndOfLoopSwitchMin = GraphLoopSwitchOfSwitchNOTValid.Link( OLoopSwitchMin , IEndOfLoopSwitchMin )
197 LLoopSwitchMaxEndOfLoopSwitchMax = GraphLoopSwitchOfSwitchNOTValid.Link( OLoopSwitchMax , IEndOfLoopSwitchMax )
199 LIsEvenaEndOfSwitcha = GraphLoopSwitchOfSwitchNOTValid.Link( OIsEvena , IEndOfSwitcha )
200 LIsEvenaEndOfSwitcha.AddCoord( 1 , 719 , 591 )
202 LSwitchOddSwitchOddGate = GraphLoopSwitchOfSwitchNOTValid.Link( OSwitchOdd , ISwitchOddGate )
204 LSwitchaIsEvena = GraphLoopSwitchOfSwitchNOTValid.Link( OSwitcha , IIsEvena )
206 LSwitchaSwitchOdda = GraphLoopSwitchOfSwitchNOTValid.Link( OSwitcha , ISwitchOdda )
208 LSwitchEvenIsEvenGate = GraphLoopSwitchOfSwitchNOTValid.Link( OSwitchEven , IIsEvenGate )
210 LSwitchDefaultEndOfSwitchDefault = GraphLoopSwitchOfSwitchNOTValid.Link( OSwitchDefault , IEndOfSwitchDefault )
211 LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 1057 , 267 )
212 LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 1079 , 669 )
213 LSwitchDefaultEndOfSwitchDefault.AddCoord( 3 , 383 , 666 )
215 LEndOfSwitchaEndOfLoopSwitchIndex = GraphLoopSwitchOfSwitchNOTValid.Link( OEndOfSwitcha , IEndOfLoopSwitchIndex )
217 LSwitchOddPOnePseudoPOneGate = GraphLoopSwitchOfSwitchNOTValid.Link( OSwitchOddPOne , IPseudoPOneGate )
219 LSwitchOddPThreePseudoPThreeGate = GraphLoopSwitchOfSwitchNOTValid.Link( OSwitchOddPThree , IPseudoPThreeGate )
221 LSwitchOddPFivePseudoPFiveGate = GraphLoopSwitchOfSwitchNOTValid.Link( OSwitchOddPFive , IPseudoPFiveGate )
223 LSwitchOddnPseudoPOnePOne = GraphLoopSwitchOfSwitchNOTValid.Link( OSwitchOddn , IPseudoPOnePOne )
225 LSwitchOddnPseudoPThreePThree = GraphLoopSwitchOfSwitchNOTValid.Link( OSwitchOddn , IPseudoPThreePThree )
227 LSwitchOddnPseudoPFivePFive = GraphLoopSwitchOfSwitchNOTValid.Link( OSwitchOddn , IPseudoPFivePFive )
229 LSwitchOddDefaultEndOfSwitchOddDefault = GraphLoopSwitchOfSwitchNOTValid.Link( OSwitchOddDefault , IEndOfSwitchOddDefault )
231 LPseudoPOneaEndOfSwitchOddn = GraphLoopSwitchOfSwitchNOTValid.Link( OPseudoPOnea , IEndOfSwitchOddn )
233 LPseudoPThreeaEndOfSwitchOddn = GraphLoopSwitchOfSwitchNOTValid.Link( OPseudoPThreea , IEndOfSwitchOddn )
235 LPseudoPFiveaEndOfSwitchOddn = GraphLoopSwitchOfSwitchNOTValid.Link( OPseudoPFivea , IEndOfSwitchOddn )
238 ILoopSwitchIndex.Input( 0 )
239 ILoopSwitchMin.Input( -5 )
240 ILoopSwitchMax.Input( 65 )
242 # Output Ports of the graph
243 #OEndOfLoopSwitchIndex = EndOfLoopSwitch.GetOutPort( 'Index' )
244 #OEndOfLoopSwitchMin = EndOfLoopSwitch.GetOutPort( 'Min' )
245 #OEndOfLoopSwitchMax = EndOfLoopSwitch.GetOutPort( 'Max' )
246 #OEndOfSwitchOddn = EndOfSwitchOdd.GetOutPort( 'n' )
247 return GraphLoopSwitchOfSwitchNOTValid
250 GraphLoopSwitchOfSwitchNOTValid = DefGraphLoopSwitchOfSwitchNOTValid()