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,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 IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' )
30 IIsOddGate = IsOdd.GetInPort( 'Gate' )
31 OIsOdda = IsOdd.OutPort( 'a' , 'long' )
32 OIsOddGate = IsOdd.GetOutPort( 'Gate' )
35 PyBadInputOfLoop.append( 'def BadInputOfLoop() : ' )
36 PyBadInputOfLoop.append( ' return 1 ' )
37 PyBadInputOfLoop.append( '' )
38 BadInputOfLoop = GraphBadInputInLoop3.INode( 'BadInputOfLoop' , PyBadInputOfLoop )
39 BadInputOfLoop.SetName( 'BadInputOfLoop' )
40 BadInputOfLoop.SetAuthor( '' )
41 BadInputOfLoop.SetComment( 'Compute Node' )
42 BadInputOfLoop.Coords( 359 , 318 )
43 IBadInputOfLoopGate = BadInputOfLoop.GetInPort( 'Gate' )
44 OBadInputOfLoopInputInLoop = BadInputOfLoop.OutPort( 'InputInLoop' , 'boolean' )
45 OBadInputOfLoopGate = BadInputOfLoop.GetOutPort( 'Gate' )
47 # Creation of Loop Nodes
50 PyMoreInitLoop.append( '' )
52 PyNextInitLoop.append( '' )
53 InitLoop,EndOfInitLoop = GraphBadInputInLoop3.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop )
54 EndOfInitLoop.SetName( 'EndOfInitLoop' )
55 EndOfInitLoop.SetAuthor( '' )
56 EndOfInitLoop.SetComment( 'Compute Node' )
57 EndOfInitLoop.Coords( 767 , 102 )
59 PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' )
60 PyEndOfInitLoop.append( ' Index = Index + 1 ' )
61 PyEndOfInitLoop.append( ' if Index <= Max : ' )
62 PyEndOfInitLoop.append( ' DoLoop = 1 ' )
63 PyEndOfInitLoop.append( ' else : ' )
64 PyEndOfInitLoop.append( ' DoLoop = 0 ' )
65 PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' )
66 EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
67 IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
68 IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
69 IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
70 IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
71 IInitLoopGate = InitLoop.GetInPort( 'Gate' )
72 OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
73 OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
74 OInitLoopMin = InitLoop.GetOutPort( 'Min' )
75 OInitLoopMax = InitLoop.GetOutPort( 'Max' )
76 IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
77 IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
78 IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
79 IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
80 IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
81 OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
82 OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
83 OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
84 OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
85 OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' )
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 )
127 LInitLoopIndexSwitcha = GraphBadInputInLoop3.Link( OInitLoopIndex , ISwitcha )
129 LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop3.Link( OInitLoopMin , IEndOfInitLoopMin )
131 LSwitchOddIsOddGate = GraphBadInputInLoop3.Link( OSwitchOdd , IIsOddGate )
133 LSwitchEvenEndSwitchDefault = GraphBadInputInLoop3.Link( OSwitchEven , IEndSwitchDefault )
135 LSwitchaIsOdda = GraphBadInputInLoop3.Link( OSwitcha , IIsOdda )
137 LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop3.Link( OEndSwitcha , IEndOfInitLoopIndex )
139 LBadInputOfLoopGateEndOfInitLoopGate = GraphBadInputInLoop3.Link( OBadInputOfLoopGate , IEndOfInitLoopGate )
142 IInitLoopIndex.Input( 0 )
143 IInitLoopMin.Input( 0 )
144 IInitLoopMax.Input( 100 )
146 # Input Ports of the graph
147 #IIsOddInputInLoop = IsOdd.GetInPort( 'InputInLoop' )
149 # Output Ports of the graph
150 #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
151 #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
152 #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
153 #OBadInputOfLoopInputInLoop = BadInputOfLoop.GetOutPort( 'InputInLoop' )
154 return GraphBadInputInLoop3
157 GraphBadInputInLoop3 = DefGraphBadInputInLoop3()