-# Generated python file of Graph GraphSwitch
+# Generated python file of Graph GraphSwitchs_1
from SuperV import *
-# Graph creation
-GraphSwitchs = Graph( 'GraphSwitchs' )
-GraphSwitchs.SetName( 'GraphSwitchs' )
-GraphSwitchs.SetAuthor( '' )
-GraphSwitchs.SetComment( '' )
-GraphSwitchs.Coords( 0 , 0 )
-# Creation of Factory Nodes
+# Graph creation of GraphSwitchs_1
+def DefGraphSwitchs_1() :
+ GraphSwitchs_1 = Graph( 'GraphSwitchs_1' )
+ GraphSwitchs_1.SetName( 'GraphSwitchs_1' )
+ GraphSwitchs_1.SetAuthor( '' )
+ GraphSwitchs_1.SetComment( '' )
+ GraphSwitchs_1.Coords( 0 , 0 )
+
+ # Creation of Factory Nodes
+
+ # Creation of InLine Nodes
+ PyIsOdd = []
+ PyIsOdd.append( 'from time import * ' )
+ PyIsOdd.append( 'def IsOdd(a) : ' )
+ PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' )
+ PyIsOdd.append( ' sleep( 1 ) ' )
+ PyIsOdd.append( ' return a ' )
+ IsOdd = GraphSwitchs_1.INode( 'IsOdd' , PyIsOdd )
+ IsOdd.SetName( 'IsOdd' )
+ IsOdd.SetAuthor( '' )
+ IsOdd.SetComment( 'Python function' )
+ IsOdd.Coords( 388 , 50 )
+ IIsOdda = IsOdd.InPort( 'a' , 'long' )
+ IIsOddGate = IsOdd.GetInPort( 'Gate' )
+ OIsOdda = IsOdd.OutPort( 'a' , 'long' )
+ OIsOddGate = IsOdd.GetOutPort( 'Gate' )
+
+ PyIsOdd_1 = []
+ PyIsOdd_1.append( 'from time import * ' )
+ PyIsOdd_1.append( 'def IsOdd(a) : ' )
+ PyIsOdd_1.append( ' print a,"IsOdd_1 (GraphSwitchs)" ' )
+ PyIsOdd_1.append( ' sleep( 1 ) ' )
+ PyIsOdd_1.append( ' return a ' )
+ IsOdd_1 = GraphSwitchs_1.INode( 'IsOdd' , PyIsOdd_1 )
+ IsOdd_1.SetName( 'IsOdd_1' )
+ IsOdd_1.SetAuthor( '' )
+ IsOdd_1.SetComment( 'Python function' )
+ IsOdd_1.Coords( 419 , 308 )
+ IIsOdd_1a = IsOdd_1.InPort( 'a' , 'long' )
+ IIsOdd_1Gate = IsOdd_1.GetInPort( 'Gate' )
+ OIsOdd_1a = IsOdd_1.OutPort( 'a' , 'long' )
+ OIsOdd_1Gate = IsOdd_1.GetOutPort( 'Gate' )
+
+ # Creation of Loop Nodes
+ PyInitLoopSwitch = []
+ PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
+ PyInitLoopSwitch.append( ' return Index,Min,Max ' )
+ PyMoreInitLoopSwitch = []
+ PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
+ PyMoreInitLoopSwitch.append( ' if Index <= Max : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' )
+ PyMoreInitLoopSwitch.append( ' else : ' )
+ PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' )
+ PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
+ PyNextInitLoopSwitch = []
+ PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
+ PyNextInitLoopSwitch.append( ' Index = Index + 1 ' )
+ PyNextInitLoopSwitch.append( ' return Index,Min,Max ' )
+ InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchs_1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
+ EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
+ EndOfInitLoopSwitch.SetAuthor( '' )
+ EndOfInitLoopSwitch.SetComment( 'Compute Node' )
+ EndOfInitLoopSwitch.Coords( 766 , 127 )
+ PyEndOfInitLoopSwitch = []
+ EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch )
+ IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' )
+ IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' )
+ IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' )
+ IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' )
+ IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' )
+ OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' )
+ OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' )
+ OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' )
+ OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' )
+ OInitLoopSwitchGate = InitLoopSwitch.GetOutPort( 'Gate' )
+ IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' )
+ IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' )
+ IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' )
+ IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' )
+ IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' )
+ OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' )
+ InitLoopSwitch.SetName( 'InitLoopSwitch' )
+ InitLoopSwitch.SetAuthor( '' )
+ InitLoopSwitch.SetComment( 'Compute Node' )
+ InitLoopSwitch.Coords( 10 , 129 )
+
+ PyInitLoop = []
+ PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' )
+ PyInitLoop.append( ' return Index,Min,Max ' )
+ PyMoreInitLoop = []
+ PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' )
+ PyMoreInitLoop.append( ' if Index <= Max : ' )
+ PyMoreInitLoop.append( ' DoLoop = 1 ' )
+ PyMoreInitLoop.append( ' else : ' )
+ PyMoreInitLoop.append( ' DoLoop = 0 ' )
+ PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' )
+ PyNextInitLoop = []
+ PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' )
+ PyNextInitLoop.append( ' Index = Index + 1 ' )
+ PyNextInitLoop.append( ' return Index,Min,Max ' )
+ InitLoop,EndOfInitLoop = GraphSwitchs_1.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop )
+ EndOfInitLoop.SetName( 'EndOfInitLoop' )
+ EndOfInitLoop.SetAuthor( '' )
+ EndOfInitLoop.SetComment( 'Compute Node' )
+ EndOfInitLoop.Coords( 783 , 381 )
+ PyEndOfInitLoop = []
+ EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop )
+ IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
+ IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
+ IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
+ IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
+ IInitLoopGate = InitLoop.GetInPort( 'Gate' )
+ OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' )
+ OInitLoopIndex = InitLoop.GetOutPort( 'Index' )
+ OInitLoopMin = InitLoop.GetOutPort( 'Min' )
+ OInitLoopMax = InitLoop.GetOutPort( 'Max' )
+ OInitLoopGate = InitLoop.GetOutPort( 'Gate' )
+ IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' )
+ IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' )
+ IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' )
+ IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' )
+ IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' )
+ OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' )
+ OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' )
+ InitLoop.SetName( 'InitLoop' )
+ InitLoop.SetAuthor( '' )
+ InitLoop.SetComment( 'Compute Node' )
+ InitLoop.Coords( 10 , 388 )
+
+ # Creation of Switch Nodes
+ PySwitch = []
+ PySwitch.append( 'from time import * ' )
+ PySwitch.append( 'def Switch(a) : ' )
+ PySwitch.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch.append( ' sleep(1) ' )
+ PySwitch.append( ' return a & 1,1-(a&1),a ' )
+ Switch,EndOfSwitch = GraphSwitchs_1.SNode( 'Switch' , PySwitch )
+ EndOfSwitch.SetName( 'EndOfSwitch' )
+ EndOfSwitch.SetAuthor( '' )
+ EndOfSwitch.SetComment( 'Compute Node' )
+ EndOfSwitch.Coords( 587 , 126 )
+ PyEndOfSwitch = []
+ EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch )
+ IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' )
+ IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' )
+ OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' )
+ OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' )
+ Switch.SetName( 'Switch' )
+ Switch.SetAuthor( '' )
+ Switch.SetComment( 'Compute Node' )
+ Switch.Coords( 186 , 130 )
+ ISwitcha = Switch.InPort( 'a' , 'long' )
+ ISwitchGate = Switch.GetInPort( 'Gate' )
+ OSwitchOdd = Switch.OutPort( 'Odd' , 'long' )
+ OSwitchEven = Switch.OutPort( 'Even' , 'int' )
+ OSwitcha = Switch.OutPort( 'a' , 'int' )
+ OSwitchDefault = Switch.GetOutPort( 'Default' )
+
+ PySwitch_1 = []
+ PySwitch_1.append( 'from time import * ' )
+ PySwitch_1.append( 'def Switch(a) : ' )
+ PySwitch_1.append( ' if ( a & 1 ) == 0 : ' )
+ PySwitch_1.append( ' sleep(1) ' )
+ PySwitch_1.append( ' return a & 1,1-(a&1),a ' )
+ Switch_1,EndSwitch = GraphSwitchs_1.SNode( 'Switch' , PySwitch_1 )
+ EndSwitch.SetName( 'EndSwitch' )
+ EndSwitch.SetAuthor( '' )
+ EndSwitch.SetComment( 'Compute Node' )
+ EndSwitch.Coords( 605 , 382 )
+ PyEndSwitch = []
+ EndSwitch.SetPyFunction( '' , PyEndSwitch )
+ IEndSwitcha = EndSwitch.InPort( 'a' , 'long' )
+ IEndSwitchDefault = EndSwitch.GetInPort( 'Default' )
+ OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' )
+ OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' )
+ Switch_1.SetName( 'Switch_1' )
+ Switch_1.SetAuthor( '' )
+ Switch_1.SetComment( 'Compute Node' )
+ Switch_1.Coords( 193 , 388 )
+ ISwitch_1a = Switch_1.InPort( 'a' , 'long' )
+ ISwitch_1Gate = Switch_1.GetInPort( 'Gate' )
+ OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' )
+ OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' )
+ OSwitch_1a = Switch_1.OutPort( 'a' , 'int' )
+ OSwitch_1Default = Switch_1.GetOutPort( 'Default' )
+
+ # Creation of Links
+ LIsOddaEndOfSwitcha = GraphSwitchs_1.Link( OIsOdda , IEndOfSwitcha )
+ LIsOddaEndOfSwitcha.AddCoord( 1 , 573 , 160 )
+ LIsOddaEndOfSwitcha.AddCoord( 2 , 572 , 130 )
+
+ LInitLoopSwitchIndexSwitcha = GraphSwitchs_1.Link( OInitLoopSwitchIndex , ISwitcha )
+
+ LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchs_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin )
+
+ LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchs_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax )
+
+ LSwitchOddIsOddGate = GraphSwitchs_1.Link( OSwitchOdd , IIsOddGate )
+
+ LSwitchaIsOdda = GraphSwitchs_1.Link( OSwitcha , IIsOdda )
+ LSwitchaIsOdda.AddCoord( 1 , 365 , 129 )
+ LSwitchaIsOdda.AddCoord( 2 , 365 , 222 )
+
+ LSwitchDefaultEndOfSwitchDefault = GraphSwitchs_1.Link( OSwitchDefault , IEndOfSwitchDefault )
+ LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 572 , 194 )
+ LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 571 , 257 )
+
+ LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchs_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex )
+
+ LIsOdd_1aEndSwitcha = GraphSwitchs_1.Link( OIsOdd_1a , IEndSwitcha )
+ LIsOdd_1aEndSwitcha.AddCoord( 1 , 599 , 416 )
+ LIsOdd_1aEndSwitcha.AddCoord( 2 , 598 , 389 )
+
+ LInitLoopIndexSwitch_1a = GraphSwitchs_1.Link( OInitLoopIndex , ISwitch_1a )
+
+ LInitLoopMinEndOfInitLoopMin = GraphSwitchs_1.Link( OInitLoopMin , IEndOfInitLoopMin )
+
+ LInitLoopMaxEndOfInitLoopMax = GraphSwitchs_1.Link( OInitLoopMax , IEndOfInitLoopMax )
+
+ LSwitch_1OddIsOdd_1Gate = GraphSwitchs_1.Link( OSwitch_1Odd , IIsOdd_1Gate )
+
+ LSwitch_1EvenEndSwitchDefault = GraphSwitchs_1.Link( OSwitch_1Even , IEndSwitchDefault )
+
+ LSwitch_1aIsOdd_1a = GraphSwitchs_1.Link( OSwitch_1a , IIsOdd_1a )
+ LSwitch_1aIsOdd_1a.AddCoord( 1 , 379 , 387 )
+ LSwitch_1aIsOdd_1a.AddCoord( 2 , 378 , 481 )
+
+ LEndSwitchaEndOfInitLoopIndex = GraphSwitchs_1.Link( OEndSwitcha , IEndOfInitLoopIndex )
+
+ # Input datas
+ IInitLoopSwitchIndex.Input( 0 )
+ IInitLoopSwitchMin.Input( 0 )
+ IInitLoopSwitchMax.Input( 20 )
+ IInitLoopIndex.Input( 0 )
+ IInitLoopMin.Input( 0 )
+ IInitLoopMax.Input( 20 )
+
+ # Output Ports of the graph
+ #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' )
+ #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' )
+ #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' )
+ #OSwitchEven = Switch.GetOutPort( 'Even' )
+ #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
+ #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
+ #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+ return GraphSwitchs_1
-# Creation of InLine Nodes
-PyIsOdd = []
-PyIsOdd.append( 'from time import * ' )
-PyIsOdd.append( 'def IsOdd(a) : ' )
-PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' )
-PyIsOdd.append( ' sleep( 1 ) ' )
-PyIsOdd.append( ' return a ' )
-IsOdd = GraphSwitchs.INode( 'IsOdd' , PyIsOdd )
-IsOdd.SetName( 'IsOdd' )
-IsOdd.SetAuthor( '' )
-IsOdd.SetComment( 'Python function' )
-IsOdd.Coords( 388 , 50 )
-IsOdd.InPort( 'a' , 'long' )
-IsOdd.OutPort( 'a' , 'long' )
-PyIsOdd_1 = []
-PyIsOdd_1.append( 'from time import * ' )
-PyIsOdd_1.append( 'def IsOdd(a) : ' )
-PyIsOdd_1.append( ' print a,"IsOdd_1 (GraphSwitchs)" ' )
-PyIsOdd_1.append( ' sleep( 1 ) ' )
-PyIsOdd_1.append( ' return a ' )
-IsOdd_1 = GraphSwitchs.INode( 'IsOdd' , PyIsOdd_1 )
-IsOdd_1.SetName( 'IsOdd_1' )
-IsOdd_1.SetAuthor( '' )
-IsOdd_1.SetComment( 'Python function' )
-IsOdd_1.Coords( 419 , 308 )
-IsOdd_1.InPort( 'a' , 'long' )
-IsOdd_1.OutPort( 'a' , 'long' )
-
-# Creation of Loop Nodes
-PyInitLoopSwitch = []
-PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' )
-PyInitLoopSwitch.append( ' return Index,Min,Max ' )
-PyMoreInitLoopSwitch = []
-PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' )
-PyMoreInitLoopSwitch.append( ' if Index <= Max : ' )
-PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' )
-PyMoreInitLoopSwitch.append( ' else : ' )
-PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' )
-PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' )
-PyNextInitLoopSwitch = []
-PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' )
-PyNextInitLoopSwitch.append( ' Index = Index + 1 ' )
-PyNextInitLoopSwitch.append( ' return Index,Min,Max ' )
-InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchs.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch )
-EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' )
-EndOfInitLoopSwitch.SetAuthor( '' )
-EndOfInitLoopSwitch.SetComment( '' )
-EndOfInitLoopSwitch.Coords( 766 , 127 )
-InitLoopSwitch.SetName( 'InitLoopSwitch' )
-InitLoopSwitch.SetAuthor( '' )
-InitLoopSwitch.SetComment( '' )
-InitLoopSwitch.Coords( 10 , 129 )
-InitLoopSwitch.InPort( 'Index' , 'long' )
-InitLoopSwitch.InPort( 'Min' , 'long' )
-InitLoopSwitch.InPort( 'Max' , 'long' )
-InitLoopSwitch.OutPort( 'Index' , 'long' )
-InitLoopSwitch.OutPort( 'Min' , 'long' )
-InitLoopSwitch.OutPort( 'Max' , 'long' )
-
-PyInitLoop = []
-PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' )
-PyInitLoop.append( ' return Index,Min,Max ' )
-PyMoreInitLoop = []
-PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' )
-PyMoreInitLoop.append( ' if Index <= Max : ' )
-PyMoreInitLoop.append( ' DoLoop = 1 ' )
-PyMoreInitLoop.append( ' else : ' )
-PyMoreInitLoop.append( ' DoLoop = 0 ' )
-PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' )
-PyNextInitLoop = []
-PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' )
-PyNextInitLoop.append( ' Index = Index + 1 ' )
-PyNextInitLoop.append( ' return Index,Min,Max ' )
-InitLoop,EndOfInitLoop = GraphSwitchs.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop )
-EndOfInitLoop.SetName( 'EndOfInitLoop' )
-EndOfInitLoop.SetAuthor( '' )
-EndOfInitLoop.SetComment( '' )
-EndOfInitLoop.Coords( 783 , 381 )
-InitLoop.SetName( 'InitLoop' )
-InitLoop.SetAuthor( '' )
-InitLoop.SetComment( '' )
-InitLoop.Coords( 10 , 388 )
-InitLoop.InPort( 'Index' , 'long' )
-InitLoop.InPort( 'Min' , 'long' )
-InitLoop.InPort( 'Max' , 'long' )
-InitLoop.OutPort( 'Index' , 'long' )
-InitLoop.OutPort( 'Min' , 'long' )
-InitLoop.OutPort( 'Max' , 'long' )
-
-# Creation of Switch Nodes
-PySwitch = []
-PySwitch.append( 'from time import * ' )
-PySwitch.append( 'def Switch(a) : ' )
-PySwitch.append( ' if ( a & 1 ) == 0 : ' )
-PySwitch.append( ' sleep(1) ' )
-PySwitch.append( ' return a & 1,1-(a&1),a ' )
-Switch,EndOfSwitch = GraphSwitchs.SNode( 'Switch' , PySwitch )
-EndOfSwitch.SetName( 'EndOfSwitch' )
-EndOfSwitch.SetAuthor( '' )
-EndOfSwitch.SetComment( '' )
-EndOfSwitch.Coords( 587 , 126 )
-PyEndOfSwitch = []
-EndOfSwitch.SetPyFunction( 'EndSwitch' , PyEndOfSwitch )
-EndOfSwitch.InPort( 'a' , 'long' )
-EndOfSwitch.OutPort( 'a' , 'long' )
-Switch.SetName( 'Switch' )
-Switch.SetAuthor( '' )
-Switch.SetComment( '' )
-Switch.Coords( 186 , 130 )
-Switch.InPort( 'a' , 'long' )
-Switch.OutPort( 'Odd' , 'long' )
-Switch.OutPort( 'Even' , 'int' )
-Switch.OutPort( 'a' , 'int' )
-
-PySwitch_1 = []
-PySwitch_1.append( 'from time import * ' )
-PySwitch_1.append( 'def Switch(a) : ' )
-PySwitch_1.append( ' if ( a & 1 ) == 0 : ' )
-PySwitch_1.append( ' sleep(1) ' )
-PySwitch_1.append( ' return a & 1,1-(a&1),a ' )
-Switch_1,EndSwitch = GraphSwitchs.SNode( 'Switch' , PySwitch_1 )
-EndSwitch.SetName( 'EndSwitch' )
-EndSwitch.SetAuthor( '' )
-EndSwitch.SetComment( '' )
-EndSwitch.Coords( 605 , 382 )
-PyEndSwitch = []
-EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch )
-EndSwitch.InPort( 'a' , 'long' )
-EndSwitch.OutPort( 'a' , 'long' )
-Switch_1.SetName( 'Switch_1' )
-Switch_1.SetAuthor( '' )
-Switch_1.SetComment( '' )
-Switch_1.Coords( 193 , 388 )
-Switch_1.InPort( 'a' , 'long' )
-Switch_1.OutPort( 'Odd' , 'long' )
-Switch_1.OutPort( 'Even' , 'int' )
-Switch_1.OutPort( 'a' , 'int' )
-
-# Creation of Links
-IsOdda = IsOdd.Port( 'a' )
-EndOfSwitcha = GraphSwitchs.Link( IsOdda , EndOfSwitch.Port( 'a' ) )
-EndOfSwitcha.AddCoord( 1 , 573 , 160 )
-EndOfSwitcha.AddCoord( 2 , 572 , 130 )
-
-InitLoopSwitchIndex = InitLoopSwitch.Port( 'Index' )
-Switcha = GraphSwitchs.Link( InitLoopSwitchIndex , Switch.Port( 'a' ) )
-
-InitLoopSwitchMin = InitLoopSwitch.Port( 'Min' )
-EndOfInitLoopSwitchMin = GraphSwitchs.Link( InitLoopSwitchMin , EndOfInitLoopSwitch.Port( 'Min' ) )
-
-InitLoopSwitchMax = InitLoopSwitch.Port( 'Max' )
-EndOfInitLoopSwitchMax = GraphSwitchs.Link( InitLoopSwitchMax , EndOfInitLoopSwitch.Port( 'Max' ) )
-
-SwitchOdd = Switch.Port( 'Odd' )
-IsOddInGate = GraphSwitchs.Link( SwitchOdd , IsOdd.Port( 'InGate' ) )
-
-Switcha = Switch.Port( 'a' )
-IsOdda = GraphSwitchs.Link( Switcha , IsOdd.Port( 'a' ) )
-IsOdda.AddCoord( 1 , 365 , 129 )
-IsOdda.AddCoord( 2 , 365 , 222 )
-
-SwitchDefault = Switch.Port( 'Default' )
-EndOfSwitchDefault = GraphSwitchs.Link( SwitchDefault , EndOfSwitch.Port( 'Default' ) )
-EndOfSwitchDefault.AddCoord( 1 , 572 , 194 )
-EndOfSwitchDefault.AddCoord( 2 , 571 , 257 )
-
-EndOfSwitcha = EndOfSwitch.Port( 'a' )
-EndOfInitLoopSwitchIndex = GraphSwitchs.Link( EndOfSwitcha , EndOfInitLoopSwitch.Port( 'Index' ) )
-
-IsOdd_1a = IsOdd_1.Port( 'a' )
-EndSwitcha = GraphSwitchs.Link( IsOdd_1a , EndSwitch.Port( 'a' ) )
-EndSwitcha.AddCoord( 1 , 599 , 416 )
-EndSwitcha.AddCoord( 2 , 598 , 389 )
-
-InitLoopIndex = InitLoop.Port( 'Index' )
-Switch_1a = GraphSwitchs.Link( InitLoopIndex , Switch_1.Port( 'a' ) )
-
-InitLoopMin = InitLoop.Port( 'Min' )
-EndOfInitLoopMin = GraphSwitchs.Link( InitLoopMin , EndOfInitLoop.Port( 'Min' ) )
-
-InitLoopMax = InitLoop.Port( 'Max' )
-EndOfInitLoopMax = GraphSwitchs.Link( InitLoopMax , EndOfInitLoop.Port( 'Max' ) )
-
-Switch_1Odd = Switch_1.Port( 'Odd' )
-IsOdd_1InGate = GraphSwitchs.Link( Switch_1Odd , IsOdd_1.Port( 'InGate' ) )
-
-Switch_1Even = Switch_1.Port( 'Even' )
-EndSwitchDefault = GraphSwitchs.Link( Switch_1Even , EndSwitch.Port( 'Default' ) )
-
-Switch_1a = Switch_1.Port( 'a' )
-IsOdd_1a = GraphSwitchs.Link( Switch_1a , IsOdd_1.Port( 'a' ) )
-IsOdd_1a.AddCoord( 1 , 379 , 387 )
-IsOdd_1a.AddCoord( 2 , 378 , 481 )
-
-EndSwitcha = EndSwitch.Port( 'a' )
-EndOfInitLoopIndex = GraphSwitchs.Link( EndSwitcha , EndOfInitLoop.Port( 'Index' ) )
-
-# Creation of Input datas
-InitLoopSwitchIndex = InitLoopSwitch.Input( 'Index' , 0)
-InitLoopSwitchMin = InitLoopSwitch.Input( 'Min' , 0)
-InitLoopSwitchMax = InitLoopSwitch.Input( 'Max' , 100)
-InitLoopIndex = InitLoop.Input( 'Index' , 0)
-InitLoopMin = InitLoop.Input( 'Min' , 0)
-InitLoopMax = InitLoop.Input( 'Max' , 100)
-
-# Creation of Output variables
-EndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.Port( 'Index' )
-EndOfInitLoopSwitchMin = EndOfInitLoopSwitch.Port( 'Min' )
-EndOfInitLoopSwitchMax = EndOfInitLoopSwitch.Port( 'Max' )
-SwitchEven = Switch.Port( 'Even' )
-EndOfInitLoopIndex = EndOfInitLoop.Port( 'Index' )
-EndOfInitLoopMin = EndOfInitLoop.Port( 'Min' )
-EndOfInitLoopMax = EndOfInitLoop.Port( 'Max' )
-
-GraphSwitchs.Run()
-GraphSwitchs.DoneW()
-GraphSwitchs.State()
-GraphSwitchs.PrintPorts()
+GraphSwitchs_1 = DefGraphSwitchs_1()