2 # Generated python file of Graph GraphBadOutputOfLoop2
6 # Graph creation of GraphBadOutputOfLoop2
7 def DefGraphBadOutputOfLoop2() :
8 GraphBadOutputOfLoop2 = Graph( 'GraphBadOutputOfLoop2' )
9 GraphBadOutputOfLoop2.SetName( 'GraphBadOutputOfLoop2' )
10 GraphBadOutputOfLoop2.SetAuthor( '' )
11 GraphBadOutputOfLoop2.SetComment( '' )
12 GraphBadOutputOfLoop2.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 (GraphLoopSwitch1)" ' )
21 PyIsOdd.append( ' sleep( 1 ) ' )
22 PyIsOdd.append( ' return a ' )
23 IsOdd = GraphBadOutputOfLoop2.INode( 'IsOdd' , PyIsOdd )
24 IsOdd.SetName( 'IsOdd' )
26 IsOdd.SetComment( 'Python function' )
27 IsOdd.Coords( 397 , 1 )
28 IIsOdda = IsOdd.InPort( 'a' , 'long' )
29 IIsOddGate = IsOdd.GetInPort( 'Gate' )
30 OIsOdda = IsOdd.OutPort( 'a' , 'long' )
31 OIsOddGate = IsOdd.GetOutPort( 'Gate' )
33 PyBadOutputOfLoop = []
34 PyBadOutputOfLoop.append( 'def BadOutputOfLoop() : ' )
35 PyBadOutputOfLoop.append( ' return 1 ' )
36 PyBadOutputOfLoop.append( '' )
37 BadOutputOfLoop = GraphBadOutputOfLoop2.INode( 'BadOutputOfLoop' , PyBadOutputOfLoop )
38 BadOutputOfLoop.SetName( 'BadOutputOfLoop' )
39 BadOutputOfLoop.SetAuthor( '' )
40 BadOutputOfLoop.SetComment( 'Compute Node' )
41 BadOutputOfLoop.Coords( 503 , 338 )
42 IBadOutputOfLoopOutputOfLoop = BadOutputOfLoop.InPort( 'OutputOfLoop' , 'long' )
43 IBadOutputOfLoopGate = BadOutputOfLoop.GetInPort( 'Gate' )
44 OBadOutputOfLoopGate = BadOutputOfLoop.GetOutPort( 'Gate' )
46 # Creation of Loop Nodes
49 PyMoreInitLoop.append( '' )
51 PyNextInitLoop.append( '' )
52 InitLoop,EndOfInitLoop = GraphBadOutputOfLoop2.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
53 EndOfInitLoop.SetName( 'EndOfInitLoop' )
54 EndOfInitLoop.SetAuthor( '' )
55 EndOfInitLoop.SetComment( 'Compute Node' )
56 EndOfInitLoop.Coords( 767 , 102 )
58 PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
59 PyEndOfInitLoop.append( ' Index = Index + 1 ' )
60 PyEndOfInitLoop.append( ' if Index <= Max : ' )
61 PyEndOfInitLoop.append( ' DoLoop = 1 ' )
62 PyEndOfInitLoop.append( ' else : ' )
63 PyEndOfInitLoop.append( ' DoLoop = 0 ' )
64 PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
65 EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
66 IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
67 IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
68 IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
69 IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
70 IInitLoopGate = InitLoop.GetInPort( 'Gate' )
71 OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
72 OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
73 OInitLoopMin = InitLoop.GetOutPort( 'Min' )
74 OInitLoopMax = InitLoop.GetOutPort( 'Max' )
75 IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
76 IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
77 IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
78 IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
79 IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
80 OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
81 OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
82 OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
83 OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
84 OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' )
85 InitLoop.SetName( 'InitLoop' )
86 InitLoop.SetAuthor( '' )
87 InitLoop.SetComment( 'Compute Node' )
88 InitLoop.Coords( 10 , 108 )
90 # Creation of Switch Nodes
92 PySwitch.append( 'from time import * ' )
93 PySwitch.append( 'def Switch(a) : ' )
94 PySwitch.append( ' if ( a & 1 ) == 0 : ' )
95 PySwitch.append( ' sleep(1) ' )
96 PySwitch.append( ' return a & 1,1-(a&1),a ' )
97 Switch,EndSwitch = GraphBadOutputOfLoop2.SNode( 'Switch' , PySwitch )
98 EndSwitch.SetName( 'EndSwitch' )
99 EndSwitch.SetAuthor( '' )
100 EndSwitch.SetComment( 'Compute Node' )
101 EndSwitch.Coords( 587 , 103 )
103 PyEndSwitch.append( 'def EndSwitch(a) : ' )
104 PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' )
105 PyEndSwitch.append( ' sleep(1) ' )
106 PyEndSwitch.append( ' return a ' )
107 EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
108 IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
109 IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
110 OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
111 OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
112 Switch.SetName( 'Switch' )
113 Switch.SetAuthor( '' )
114 Switch.SetComment( 'Compute Node' )
115 Switch.Coords( 194 , 109 )
116 ISwitcha = Switch.InPort( 'a' , 'long' )
117 ISwitchGate = Switch.GetInPort( 'Gate' )
118 OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
119 OSwitchEven = Switch.OutPort( 'Even' , 'int' )
120 OSwitcha = Switch.OutPort( 'a' , 'int' )
121 OSwitchDefault = Switch.GetOutPort( 'Default' )
124 LIsOddaEndSwitcha = GraphBadOutputOfLoop2.Link( OIsOdda , IEndSwitcha )
126 LInitLoopIndexSwitcha = GraphBadOutputOfLoop2.Link( OInitLoopIndex , ISwitcha )
128 LInitLoopMinEndOfInitLoopMin = GraphBadOutputOfLoop2.Link( OInitLoopMin , IEndOfInitLoopMin )
130 LSwitchOddIsOddGate = GraphBadOutputOfLoop2.Link( OSwitchOdd , IIsOddGate )
132 LSwitchEvenEndSwitchDefault = GraphBadOutputOfLoop2.Link( OSwitchEven , IEndSwitchDefault )
134 LSwitchaBadOutputOfLoopOutputOfLoop = GraphBadOutputOfLoop2.Link( OSwitcha , IBadOutputOfLoopOutputOfLoop )
136 LSwitchaIsOdda = GraphBadOutputOfLoop2.Link( OSwitcha , IIsOdda )
138 LEndSwitchaEndOfInitLoopIndex = GraphBadOutputOfLoop2.Link( OEndSwitcha , IEndOfInitLoopIndex )
141 IInitLoopIndex.Input( 0 )
142 IInitLoopMin.Input( 0 )
143 IInitLoopMax.Input( 100 )
145 # Output Ports of the graph
146 #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
147 #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
148 #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
149 return GraphBadOutputOfLoop2
152 GraphBadOutputOfLoop2 = DefGraphBadOutputOfLoop2()