2 # Generated python file of Graph GraphBadInputInLoop3
6 # Graph creation of GraphBadInputInLoop3
7 def DefGraphBadInputInLoop3() :
8 GraphBadInputInLoop3 = Graph( 'GraphBadInputInLoop3' )
9 GraphBadInputInLoop3.SetName( 'GraphBadInputInLoop3' )
10 GraphBadInputInLoop3.SetAuthor( '' )
11 GraphBadInputInLoop3.SetComment( '' )
12 GraphBadInputInLoop3.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,Even,InputInLoop) : ' )
20 PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' )
21 PyIsOdd.append( ' sleep( 1 ) ' )
22 PyIsOdd.append( ' return a ' )
23 IsOdd = GraphBadInputInLoop3.INode( 'IsOdd' , PyIsOdd )
24 IsOdd.SetName( 'IsOdd' )
26 IsOdd.SetComment( 'Python function' )
27 IsOdd.Coords( 397 , 1 )
28 IIsOdda = IsOdd.InPort( 'a' , 'long' )
29 IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' )
30 IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' )
31 IIsOddGate = IsOdd.GetInPort( 'Gate' )
32 OIsOdda = IsOdd.OutPort( 'a' , 'long' )
33 OIsOddGate = IsOdd.GetOutPort( 'Gate' )
36 PyBadInputOfLoop.append( 'def BadInputOfLoop() : ' )
37 PyBadInputOfLoop.append( ' return 1 ' )
38 PyBadInputOfLoop.append( '' )
39 BadInputOfLoop = GraphBadInputInLoop3.INode( 'BadInputOfLoop' , PyBadInputOfLoop )
40 BadInputOfLoop.SetName( 'BadInputOfLoop' )
41 BadInputOfLoop.SetAuthor( '' )
42 BadInputOfLoop.SetComment( 'Compute Node' )
43 BadInputOfLoop.Coords( 359 , 318 )
44 IBadInputOfLoopGate = BadInputOfLoop.GetInPort( 'Gate' )
45 OBadInputOfLoopInputInLoop = BadInputOfLoop.OutPort( 'InputInLoop' , 'boolean' )
46 OBadInputOfLoopGate = BadInputOfLoop.GetOutPort( 'Gate' )
48 # Creation of Loop Nodes
51 PyMoreInitLoop.append( '' )
53 PyNextInitLoop.append( '' )
54 InitLoop,EndOfInitLoop = GraphBadInputInLoop3.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
55 EndOfInitLoop.SetName( 'EndOfInitLoop' )
56 EndOfInitLoop.SetAuthor( '' )
57 EndOfInitLoop.SetComment( 'Compute Node' )
58 EndOfInitLoop.Coords( 767 , 102 )
60 PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
61 PyEndOfInitLoop.append( ' Index = Index + 1 ' )
62 PyEndOfInitLoop.append( ' if Index <= Max : ' )
63 PyEndOfInitLoop.append( ' DoLoop = 1 ' )
64 PyEndOfInitLoop.append( ' else : ' )
65 PyEndOfInitLoop.append( ' DoLoop = 0 ' )
66 PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
67 EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
68 IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' )
69 IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
70 IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
71 IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
72 IInitLoopGate = InitLoop.GetInPort( 'Gate' )
73 OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
74 OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
75 OInitLoopMin = InitLoop.GetOutPort( 'Min' )
76 OInitLoopMax = InitLoop.GetOutPort( 'Max' )
77 IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
78 IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
79 IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
80 IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
81 IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
82 OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
83 OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
84 OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
85 OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
86 InitLoop.SetName( 'InitLoop' )
87 InitLoop.SetAuthor( '' )
88 InitLoop.SetComment( 'Compute Node' )
89 InitLoop.Coords( 10 , 108 )
91 # Creation of Switch Nodes
93 PySwitch.append( 'from time import * ' )
94 PySwitch.append( 'def Switch(a) : ' )
95 PySwitch.append( ' if ( a & 1 ) == 0 : ' )
96 PySwitch.append( ' sleep(1) ' )
97 PySwitch.append( ' return a & 1,1-(a&1),a ' )
98 Switch,EndSwitch = GraphBadInputInLoop3.SNode( 'Switch' , PySwitch )
99 EndSwitch.SetName( 'EndSwitch' )
100 EndSwitch.SetAuthor( '' )
101 EndSwitch.SetComment( 'Compute Node' )
102 EndSwitch.Coords( 587 , 103 )
104 PyEndSwitch.append( 'def EndSwitch(a) : ' )
105 PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
106 PyEndSwitch.append( ' sleep(1) ' )
107 PyEndSwitch.append( ' return a ' )
108 EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
109 IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
110 IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
111 OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
112 OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
113 Switch.SetName( 'Switch' )
114 Switch.SetAuthor( '' )
115 Switch.SetComment( 'Compute Node' )
116 Switch.Coords( 194 , 109 )
117 ISwitcha = Switch.InPort( 'a' , 'long' )
118 ISwitchGate = Switch.GetInPort( 'Gate' )
119 OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
120 OSwitchEven = Switch.OutPort( 'Even' , 'int' )
121 OSwitcha = Switch.OutPort( 'a' , 'int' )
122 OSwitchDefault = Switch.GetOutPort( 'Default' )
125 LIsOddaEndSwitcha = GraphBadInputInLoop3.Link( OIsOdda , IEndSwitcha )
126 LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 )
127 LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 )
129 LInitLoopIndexSwitcha = GraphBadInputInLoop3.Link( OInitLoopIndex , ISwitcha )
131 LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop3.Link( OInitLoopMin , IEndOfInitLoopMin )
133 LSwitchOddIsOddGate = GraphBadInputInLoop3.Link( OSwitchOdd , IIsOddGate )
135 LSwitchEvenEndSwitchDefault = GraphBadInputInLoop3.Link( OSwitchEven , IEndSwitchDefault )
137 LSwitchEvenIsOddEven = GraphBadInputInLoop3.Link( OSwitchEven , IIsOddEven )
138 LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 )
139 LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 )
141 LSwitchaIsOdda = GraphBadInputInLoop3.Link( OSwitcha , IIsOdda )
142 LSwitchaIsOdda.AddCoord( 1 , 362 , 82 )
143 LSwitchaIsOdda.AddCoord( 2 , 360 , 201 )
145 LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop3.Link( OEndSwitcha , IEndOfInitLoopIndex )
147 LBadInputOfLoopGateEndOfInitLoopGate = GraphBadInputInLoop3.Link( OBadInputOfLoopGate , IEndOfInitLoopGate )
150 IInitLoopIndex.Input( 0 )
151 IInitLoopMin.Input( 0 )
152 IInitLoopMax.Input( 100 )
153 IEndOfInitLoopMax.Input( 136221856 )
155 # Input Ports of the graph
156 #IIsOddInputInLoop = IsOdd.GetInPort( 'InputInLoop' )
158 # Output Ports of the graph
159 #OInitLoopMax = InitLoop.GetOutPort( 'Max' )
160 #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
161 #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
162 #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
163 #OBadInputOfLoopInputInLoop = BadInputOfLoop.GetOutPort( 'InputInLoop' )
164 return GraphBadInputInLoop3
167 GraphBadInputInLoop3 = DefGraphBadInputInLoop3()