]> SALOME platform Git repositories - modules/superv.git/blobdiff - examples/GraphSyrControl.py
Salome HOME
DCQ : Merge with Ecole_Ete_a6.
[modules/superv.git] / examples / GraphSyrControl.py
index 0c647d277e5d99b5f5f6457f1be9724a06834d12..5756e845ee79b567c2cd389d37fe20e996cc9c3e 100644 (file)
@@ -10,36 +10,41 @@ GraphSyrControl.SetComment( 'Syracuse algorithm' )
 GraphSyrControl.Coords( 0 , 0 )
 
 # Creation of Factory Nodes
+
 test_ISEVEN = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
 test_ISEVEN.SetName( 'test_ISEVEN' )
 test_ISEVEN.SetAuthor( '' )
 test_ISEVEN.SetContainer( 'localhost/FactoryServer' )
 test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' )
 test_ISEVEN.Coords( 190 , 338 )
+
 test_ISONE = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
 test_ISONE.SetName( 'test_ISONE' )
 test_ISONE.SetAuthor( '' )
 test_ISONE.SetContainer( 'localhost/FactoryServer' )
 test_ISONE.SetComment( 'C_ISONE from SyrComponent' )
 test_ISONE.Coords( 196 , 131 )
+
 m3p1 = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
 m3p1.SetName( 'm3p1' )
 m3p1.SetAuthor( '' )
 m3p1.SetContainer( 'localhost/FactoryServer' )
 m3p1.SetComment( 'C_M3P1 from SyrComponent' )
-m3p1.Coords( 621 , 14 )
+m3p1.Coords( 788 , 22 )
+
 div2 = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
 div2.SetName( 'div2' )
 div2.SetAuthor( '' )
 div2.SetContainer( 'localhost/FactoryServer' )
 div2.SetComment( 'C_DIV2 from SyrComponent' )
-div2.Coords( 624 , 391 )
+div2.Coords( 794 , 427 )
+
 incr = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
 incr.SetName( 'incr' )
 incr.SetAuthor( '' )
 incr.SetContainer( 'localhost/FactoryServer' )
 incr.SetComment( 'C_INCR from SyrComponent' )
-incr.Coords( 622 , 199 )
+incr.Coords( 790 , 158 )
 
 # Creation of InLine Nodes
 Pylabel_begin = []
@@ -55,6 +60,7 @@ label_begin.SetName( 'label_begin' )
 label_begin.SetAuthor( '' )
 label_begin.SetComment( 'Python function' )
 label_begin.Coords( 7 , 216 )
+
 Pylabel_test = []
 Pylabel_test.append( 'def label_test( ValEven , ValOne , NB , KB ):' )
 Pylabel_test.append( '    print "label_begin",ValEven,ValOne,NB,KB' )
@@ -71,7 +77,7 @@ label_test.OutPort( 'KT' , 'long' )
 label_test.SetName( 'label_test' )
 label_test.SetAuthor( '' )
 label_test.SetComment( 'Python function' )
-label_test.Coords( 7 , 216 )
+label_test.Coords( 385 , 159 )
 
 # Creation of Switch Nodes
 Pytest = []
@@ -94,7 +100,7 @@ test,EndSwitch_OneEven = GraphSyrControl.SNode( 'Switch_OneEven' , Pytest )
 EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' )
 EndSwitch_OneEven.SetAuthor( '' )
 EndSwitch_OneEven.SetComment( '' )
-EndSwitch_OneEven.Coords( 0 , 0 )
+EndSwitch_OneEven.Coords( 1065 , 321 )
 PyEndSwitch_OneEven = []
 PyEndSwitch_OneEven.append( 'def EndSwitch_OneEven( Finished , K ):' )
 PyEndSwitch_OneEven.append( '    print "label_begin",Finished,K' )
@@ -117,7 +123,7 @@ test.OutPort( 'K' , 'long' )
 test.SetName( 'test' )
 test.SetAuthor( '' )
 test.SetComment( '' )
-test.Coords( 399 , 176 )
+test.Coords( 592 , 205 )
 
 # Creation of GOTO Nodes
 Pycontrol_m3p1 = []
@@ -133,7 +139,8 @@ control_m3p1.OutPort( 'KT' , 'long' )
 control_m3p1.SetName( 'control_m3p1' )
 control_m3p1.SetAuthor( '' )
 control_m3p1.SetComment( '' )
-control_m3p1.Coords( 814 , 13 )
+control_m3p1.Coords( 1012 , 68 )
+
 Pycontrol_div2 = []
 Pycontrol_div2.append( 'def control_div2( N , NB ) :' )
 Pycontrol_div2.append( '    return N,NB' )
@@ -145,56 +152,108 @@ control_div2.OutPort( 'KB' , 'long' )
 control_div2.SetName( 'control_div2' )
 control_div2.SetAuthor( '' )
 control_div2.SetComment( '' )
-control_div2.Coords( 812 , 414 )
+control_div2.Coords( 1010 , 473 )
 
-# Creation of intermediate Output variables and of Control Links
+# Creation of Links
 test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' )
 label_testValEven = GraphSyrControl.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) )
+label_testValEven.AddCoord( 1 , 380 , 236 )
+label_testValEven.AddCoord( 2 , 379 , 419 )
+
 test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' )
 label_testValOne = GraphSyrControl.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) )
+label_testValOne.AddCoord( 1 , 367 , 269 )
+label_testValOne.AddCoord( 2 , 367 , 213 )
+
 m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' )
 control_m3p1N = GraphSyrControl.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) )
+
 div2anInteger = div2.Port( 'anInteger' )
 control_div2N = GraphSyrControl.Link( div2anInteger , control_div2.Port( 'N' ) )
+
 incraNewCount = incr.Port( 'aNewCount' )
 control_m3p1K = GraphSyrControl.Link( incraNewCount , control_m3p1.Port( 'K' ) )
+control_m3p1K.AddCoord( 1 , 978 , 132 )
+control_m3p1K.AddCoord( 2 , 978 , 239 )
+
 control_div2K = GraphSyrControl.Link( incraNewCount , control_div2.Port( 'K' ) )
+control_div2K.AddCoord( 1 , 979 , 536 )
+control_div2K.AddCoord( 2 , 978 , 240 )
+
 label_beginNT = label_begin.Port( 'NT' )
 label_testNT = GraphSyrControl.Link( label_beginNT , label_test.Port( 'NT' ) )
+
 test_ISEVENanInteger = GraphSyrControl.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) )
+test_ISEVENanInteger.AddCoord( 1 , 184 , 416 )
+test_ISEVENanInteger.AddCoord( 2 , 185 , 298 )
+
 test_ISONEanInteger = GraphSyrControl.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) )
+test_ISONEanInteger.AddCoord( 1 , 186 , 211 )
+test_ISONEanInteger.AddCoord( 2 , 185 , 297 )
+
 label_beginKT = label_begin.Port( 'KT' )
 label_testKT = GraphSyrControl.Link( label_beginKT , label_test.Port( 'KT' ) )
+
 label_testValEven = label_test.Port( 'ValEven' )
 testValEven = GraphSyrControl.Link( label_testValEven , test.Port( 'ValEven' ) )
+
 label_testValOne = label_test.Port( 'ValOne' )
 testValOne = GraphSyrControl.Link( label_testValOne , test.Port( 'ValOne' ) )
+
 label_testNT = label_test.Port( 'NT' )
 testNT = GraphSyrControl.Link( label_testNT , test.Port( 'NT' ) )
+
 label_testKT = label_test.Port( 'KT' )
 testKT = GraphSyrControl.Link( label_testKT , test.Port( 'KT' ) )
-testDefault = test.Port( 'Default' )
-EndSwitch_OneEvenDefault = GraphSyrControl.Link( testDefault , EndSwitch_OneEven.Port( 'Default' ) )
+
 testFinished = test.Port( 'Finished' )
 EndSwitch_OneEvenFinished = GraphSyrControl.Link( testFinished , EndSwitch_OneEven.Port( 'Finished' ) )
+
 testIncr = test.Port( 'Incr' )
 incrInGate = GraphSyrControl.Link( testIncr , incr.Port( 'InGate' ) )
+
 testEven = test.Port( 'Even' )
 div2InGate = GraphSyrControl.Link( testEven , div2.Port( 'InGate' ) )
+div2InGate.AddCoord( 1 , 764 , 536 )
+div2InGate.AddCoord( 2 , 763 , 297 )
+
 testOdd = test.Port( 'Odd' )
 m3p1InGate = GraphSyrControl.Link( testOdd , m3p1.Port( 'InGate' ) )
+m3p1InGate.AddCoord( 1 , 773 , 133 )
+m3p1InGate.AddCoord( 2 , 773 , 326 )
+
 testN = test.Port( 'N' )
 m3p1anOddInteger = GraphSyrControl.Link( testN , m3p1.Port( 'anOddInteger' ) )
+m3p1anOddInteger.AddCoord( 1 , 753 , 102 )
+m3p1anOddInteger.AddCoord( 2 , 752 , 355 )
+
 div2anEvenInteger = GraphSyrControl.Link( testN , div2.Port( 'anEvenInteger' ) )
+div2anEvenInteger.AddCoord( 1 , 753 , 508 )
+div2anEvenInteger.AddCoord( 2 , 752 , 356 )
+
 testK = test.Port( 'K' )
 EndSwitch_OneEvenK = GraphSyrControl.Link( testK , EndSwitch_OneEven.Port( 'K' ) )
+
 incraCount = GraphSyrControl.Link( testK , incr.Port( 'aCount' ) )
+incraCount.AddCoord( 1 , 779 , 239 )
+incraCount.AddCoord( 2 , 780 , 385 )
+
+testDefault = test.Port( 'Default' )
+EndSwitch_OneEvenDefault = GraphSyrControl.Link( testDefault , EndSwitch_OneEven.Port( 'Default' ) )
 
-# Creation of intermediate Output variables and of Loop Links
 control_m3p1OutGate = control_m3p1.Port( 'OutGate' )
 label_testInGate = GraphSyrControl.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) )
+label_testInGate.AddCoord( 1 , 373 , 354 )
+label_testInGate.AddCoord( 2 , 372 , 10 )
+label_testInGate.AddCoord( 3 , 1180 , 9 )
+label_testInGate.AddCoord( 4 , 1181 , 217 )
+
 control_div2OutGate = control_div2.Port( 'OutGate' )
 label_beginInGate = GraphSyrControl.Link( control_div2OutGate , label_begin.Port( 'InGate' ) )
+label_beginInGate.AddCoord( 1 , 5 , 355 )
+label_beginInGate.AddCoord( 2 , 4 , 608 )
+label_beginInGate.AddCoord( 3 , 1177 , 608 )
+label_beginInGate.AddCoord( 4 , 1177 , 563 )
 
 # Creation of Input datas
 label_beginNB = label_begin.Input( 'NB' , 7)