From fcd3bf4a1240b54d289cc6ea3852492c935b84d4 Mon Sep 17 00:00:00 2001 From: rahuel Date: Mon, 17 Jan 2005 13:10:47 +0000 Subject: [PATCH] That graph was wrong : 2 branches of the SwitchNode were executed at the same time ; that is not allowed. It is now corrected : there is only 2 brnaches now. --- examples/GraphGOTO.py | 76 +++++++------ examples/GraphGOTO.xml | 249 +++++++++++++++++++++++------------------ 2 files changed, 183 insertions(+), 142 deletions(-) diff --git a/examples/GraphGOTO.py b/examples/GraphGOTO.py index d6af11f..4d555c2 100644 --- a/examples/GraphGOTO.py +++ b/examples/GraphGOTO.py @@ -40,7 +40,7 @@ def DefGraphGOTO() : m3p1.SetAuthor( '' ) m3p1.SetContainer( 'localhost/FactoryServer' ) m3p1.SetComment( 'C_M3P1 from SyrComponent' ) - m3p1.Coords( 784 , 36 ) + m3p1.Coords( 861 , 46 ) Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) Im3p1Gate = m3p1.GetInPort( 'Gate' ) Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) @@ -51,7 +51,7 @@ def DefGraphGOTO() : div2.SetAuthor( '' ) div2.SetContainer( 'localhost/FactoryServer' ) div2.SetComment( 'C_DIV2 from SyrComponent' ) - div2.Coords( 788 , 409 ) + div2.Coords( 858 , 466 ) Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) Idiv2Gate = div2.GetInPort( 'Gate' ) Odiv2anInteger = div2.GetOutPort( 'anInteger' ) @@ -62,12 +62,23 @@ def DefGraphGOTO() : incr.SetAuthor( '' ) incr.SetContainer( 'localhost/FactoryServer' ) incr.SetComment( 'C_INCR from SyrComponent' ) - incr.Coords( 788 , 230 ) + incr.Coords( 865 , 169 ) IincraCount = incr.GetInPort( 'aCount' ) IincrGate = incr.GetInPort( 'Gate' ) OincraNewCount = incr.GetOutPort( 'aNewCount' ) OincrGate = incr.GetOutPort( 'Gate' ) + incr_1 = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr_1.SetName( 'incr_1' ) + incr_1.SetAuthor( '' ) + incr_1.SetContainer( 'localhost/FactoryServer' ) + incr_1.SetComment( 'C_INCR from SyrComponent' ) + incr_1.Coords( 859 , 338 ) + Iincr_1aCount = incr_1.GetInPort( 'aCount' ) + Iincr_1Gate = incr_1.GetInPort( 'Gate' ) + Oincr_1aNewCount = incr_1.GetOutPort( 'aNewCount' ) + Oincr_1Gate = incr_1.GetOutPort( 'Gate' ) + # Creation of InLine Nodes Pylabel_begin = [] Pylabel_begin.append( 'def label_begin( NB , KB ):' ) @@ -126,7 +137,7 @@ def DefGraphGOTO() : EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) EndSwitch_OneEven.SetAuthor( '' ) EndSwitch_OneEven.SetComment( 'Compute Node' ) - EndSwitch_OneEven.Coords( 1152 , 292 ) + EndSwitch_OneEven.Coords( 1256 , 305 ) PyEndSwitch_OneEven = [] PyEndSwitch_OneEven.append( 'def EndSwitch_OneEven( Finished , K ):' ) PyEndSwitch_OneEven.append( ' print "label_begin",Finished,K' ) @@ -163,7 +174,7 @@ def DefGraphGOTO() : control_m3p1.SetName( 'control_m3p1' ) control_m3p1.SetAuthor( '' ) control_m3p1.SetComment( 'Compute Node' ) - control_m3p1.Coords( 980 , 81 ) + control_m3p1.Coords( 1073 , 87 ) Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' ) Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' ) Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' ) @@ -180,7 +191,7 @@ def DefGraphGOTO() : control_div2.SetName( 'control_div2' ) control_div2.SetAuthor( '' ) control_div2.SetComment( 'Compute Node' ) - control_div2.Coords( 1039 , 454 ) + control_div2.Coords( 1128 , 453 ) Icontrol_div2N = control_div2.InPort( 'N' , 'long' ) Icontrol_div2K = control_div2.InPort( 'K' , 'long' ) Icontrol_div2Gate = control_div2.GetInPort( 'Gate' ) @@ -202,12 +213,10 @@ def DefGraphGOTO() : Ldiv2anIntegercontrol_div2N = GraphGOTO.Link( Odiv2anInteger , Icontrol_div2N ) LincraNewCountcontrol_m3p1K = GraphGOTO.Link( OincraNewCount , Icontrol_m3p1K ) - LincraNewCountcontrol_m3p1K.AddCoord( 1 , 964 , 145 ) - LincraNewCountcontrol_m3p1K.AddCoord( 2 , 964 , 309 ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 1048 , 139 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 1048 , 241 ) - LincraNewCountcontrol_div2K = GraphGOTO.Link( OincraNewCount , Icontrol_div2K ) - LincraNewCountcontrol_div2K.AddCoord( 1 , 963 , 518 ) - LincraNewCountcontrol_div2K.AddCoord( 2 , 964 , 312 ) + Lincr_1aNewCountcontrol_div2K = GraphGOTO.Link( Oincr_1aNewCount , Icontrol_div2K ) Llabel_beginNTlabel_testNT = GraphGOTO.Link( Olabel_beginNT , Ilabel_testNT ) @@ -236,55 +245,58 @@ def DefGraphGOTO() : LtestFinishedEndSwitch_OneEvenFinished = GraphGOTO.Link( OtestFinished , IEndSwitch_OneEvenFinished ) - LtestIncrincrGate = GraphGOTO.Link( OtestIncr , IincrGate ) - LtestIncrincrGate.AddCoord( 1 , 783 , 341 ) - LtestIncrincrGate.AddCoord( 2 , 782 , 302 ) + LtestEvenincr_1Gate = GraphGOTO.Link( OtestEven , Iincr_1Gate ) LtestEvendiv2Gate = GraphGOTO.Link( OtestEven , Idiv2Gate ) - LtestEvendiv2Gate.AddCoord( 1 , 754 , 518 ) - LtestEvendiv2Gate.AddCoord( 2 , 753 , 330 ) + LtestEvendiv2Gate.AddCoord( 1 , 793 , 561 ) + LtestEvendiv2Gate.AddCoord( 2 , 794 , 310 ) + + LtestOddincrGate = GraphGOTO.Link( OtestOdd , IincrGate ) LtestOddm3p1Gate = GraphGOTO.Link( OtestOdd , Im3p1Gate ) - LtestOddm3p1Gate.AddCoord( 1 , 758 , 145 ) - LtestOddm3p1Gate.AddCoord( 2 , 760 , 359 ) + LtestOddm3p1Gate.AddCoord( 1 , 778 , 138 ) + LtestOddm3p1Gate.AddCoord( 2 , 780 , 328 ) LtestNm3p1anOddInteger = GraphGOTO.Link( OtestN , Im3p1anOddInteger ) - LtestNm3p1anOddInteger.AddCoord( 1 , 767 , 116 ) - LtestNm3p1anOddInteger.AddCoord( 2 , 767 , 116 ) - LtestNm3p1anOddInteger.AddCoord( 3 , 767 , 390 ) + LtestNm3p1anOddInteger.AddCoord( 1 , 808 , 113 ) + LtestNm3p1anOddInteger.AddCoord( 2 , 807 , 352 ) LtestNdiv2anEvenInteger = GraphGOTO.Link( OtestN , Idiv2anEvenInteger ) - LtestNdiv2anEvenInteger.AddCoord( 1 , 767 , 489 ) - LtestNdiv2anEvenInteger.AddCoord( 2 , 766 , 389 ) + LtestNdiv2anEvenInteger.AddCoord( 1 , 806 , 537 ) + LtestNdiv2anEvenInteger.AddCoord( 2 , 807 , 351 ) LtestKEndSwitch_OneEvenK = GraphGOTO.Link( OtestK , IEndSwitch_OneEvenK ) LtestKincraCount = GraphGOTO.Link( OtestK , IincraCount ) - LtestKincraCount.AddCoord( 1 , 772 , 311 ) - LtestKincraCount.AddCoord( 2 , 772 , 417 ) - LtestKincraCount.AddCoord( 3 , 772 , 417 ) + LtestKincraCount.AddCoord( 1 , 773 , 236 ) + LtestKincraCount.AddCoord( 2 , 773 , 370 ) + + LtestKincr_1aCount = GraphGOTO.Link( OtestK , Iincr_1aCount ) + LtestKincr_1aCount.AddCoord( 1 , 774 , 409 ) + LtestKincr_1aCount.AddCoord( 2 , 773 , 368 ) LtestDefaultEndSwitch_OneEvenDefault = GraphGOTO.Link( OtestDefault , IEndSwitch_OneEvenDefault ) - LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 1 , 778 , 384 ) - LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 2 , 778 , 448 ) + LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 1 , 840 , 381 ) + LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 2 , 839 , 394 ) Lcontrol_m3p1Gatelabel_testGate = GraphGOTO.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 388 , 388 ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 389 , 597 ) - Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1319 , 597 ) - Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1318 , 231 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1441 , 604 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1441 , 199 ) Lcontrol_div2Gatelabel_beginGate = GraphGOTO.Link( Ocontrol_div2Gate , Ilabel_beginGate ) Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 4 , 388 ) Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 3 , 587 ) - Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1214 , 588 ) - Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1213 , 546 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1307 , 586 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1307 , 528 ) # Input datas Ilabel_beginNB.Input( 7 ) Ilabel_beginKB.Input( 0 ) # Output Ports of the graph + #OtestIncr = test.GetOutPort( 'Incr' ) #OEndSwitch_OneEvenFinished = EndSwitch_OneEven.GetOutPort( 'Finished' ) #OEndSwitch_OneEvenK = EndSwitch_OneEven.GetOutPort( 'K' ) return GraphGOTO diff --git a/examples/GraphGOTO.xml b/examples/GraphGOTO.xml index 967674f..fc3884b 100644 --- a/examples/GraphGOTO.xml +++ b/examples/GraphGOTO.xml @@ -5,11 +5,11 @@ ? ? - GraphGOTO + GraphGOTO_2 1 ? -GraphSyrControl +GraphGOTO_2 long @@ -19,6 +19,9 @@ label_begin__KB +long + test__Incr + long EndSwitch_OneEven__Finished @@ -26,9 +29,9 @@ EndSwitch_OneEven__K - 11/3/2003 - 18:34:21 - 14/12/2004 - 15:48:37 - 1.04 + 17/1/2005 - 13:44:46 + 17/1/2005 - 13:47:40 + 2.0 JR ? Syracuse algorithm @@ -53,9 +56,9 @@ BoolEven - 14/12/2004 - 15:48:37 - 14/12/2004 - 15:48:37 - 1.04 + 17/1/2005 - 13:45:36 + 17/1/2005 - 13:45:36 + 2.0 ? localhost/FactoryServer C_ISEVEN from SyrComponent @@ -79,9 +82,9 @@ BoolOne - 14/12/2004 - 15:48:37 - 14/12/2004 - 15:48:37 - 1.04 + 17/1/2005 - 13:45:36 + 17/1/2005 - 13:45:36 + 2.0 ? localhost/FactoryServer C_ISONE from SyrComponent @@ -105,14 +108,14 @@ anEvenInteger - 14/12/2004 - 15:48:37 - 14/12/2004 - 15:48:37 - 1.04 + 17/1/2005 - 13:45:36 + 17/1/2005 - 13:45:36 + 2.0 ? localhost/FactoryServer C_M3P1 from SyrComponent - 784 - 36 + 861 + 46 SyrComponent SyrComponent @@ -131,14 +134,14 @@ anInteger - 14/12/2004 - 15:48:37 - 14/12/2004 - 15:48:37 - 1.04 + 17/1/2005 - 13:45:36 + 17/1/2005 - 13:45:36 + 2.0 ? localhost/FactoryServer C_DIV2 from SyrComponent - 788 - 409 + 858 + 466 SyrComponent SyrComponent @@ -157,14 +160,40 @@ aNewCount - 14/12/2004 - 15:48:37 - 14/12/2004 - 15:48:37 - 1.04 + 17/1/2005 - 13:45:36 + 17/1/2005 - 13:45:36 + 2.0 ? localhost/FactoryServer C_INCR from SyrComponent - 788 - 230 + 865 + 169 + +SyrComponent + SyrComponent + incr_1 + 0 + ? + +C_INCR + + +long + aCount + + +long + aNewCount + + + 17/1/2005 - 13:45:36 + 17/1/2005 - 13:45:36 + 2.0 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 859 + 338 ? ? @@ -194,9 +223,9 @@ - 14/12/2004 - 15:48:37 - 14/12/2004 - 15:48:37 - 1.04 + 17/1/2005 - 13:45:36 + 17/1/2005 - 13:45:36 + 2.0 ? ? Python function @@ -243,9 +272,9 @@ - 14/12/2004 - 15:48:37 - 14/12/2004 - 15:48:37 - 1.04 + 17/1/2005 - 13:45:36 + 17/1/2005 - 13:45:36 + 2.0 ? ? Python function @@ -310,9 +339,9 @@ - 14/12/2004 - 15:48:37 - 14/12/2004 - 15:48:37 - 1.04 + 17/1/2005 - 13:45:36 + 17/1/2005 - 13:45:36 + 2.0 ? ? Compute Node @@ -347,14 +376,14 @@ - 14/12/2004 - 15:48:37 - 14/12/2004 - 15:48:37 - 1.04 + 17/1/2005 - 13:45:36 + 17/1/2005 - 13:45:36 + 2.0 ? ? Compute Node - 1152 - 292 + 1256 + 305 ? ? @@ -389,14 +418,14 @@ control_m3p1 - 14/12/2004 - 15:48:37 - 14/12/2004 - 15:48:37 - 1.04 + 17/1/2005 - 13:45:36 + 17/1/2005 - 13:45:36 + 2.0 ? ? Compute Node - 980 - 81 + 1073 + 87 ? ? @@ -425,14 +454,14 @@ control_div2 - 14/12/2004 - 15:48:37 - 14/12/2004 - 15:48:37 - 1.04 + 17/1/2005 - 13:45:36 + 17/1/2005 - 13:45:36 + 2.0 ? ? Compute Node - 1039 - 454 + 1128 + 453 test_ISEVEN @@ -477,23 +506,17 @@ K -964 - 145 +1048 + 139 -964 - 309 +1048 + 241 -incr +incr_1 aNewCount control_div2 K - - -963 - 518 - -964 - 312 + label_begin NT @@ -577,16 +600,10 @@ test - Incr - incr + Even + incr_1 Gate - - -783 - 341 - -782 - 302 + test Even @@ -594,11 +611,17 @@ Gate -754 - 518 +793 + 561 -753 - 330 +794 + 310 + +test + Odd + incr + Gate + test Odd @@ -606,11 +629,11 @@ Gate -758 - 145 +778 + 138 -760 - 359 +780 + 328 test N @@ -618,14 +641,11 @@ anOddInteger -767 - 116 - -767 - 116 +808 + 113 -767 - 390 +807 + 352 test N @@ -633,11 +653,11 @@ anEvenInteger -767 - 489 +806 + 537 -766 - 389 +807 + 351 test K @@ -651,14 +671,23 @@ aCount -772 - 311 +773 + 236 -772 - 417 +773 + 370 + +test + K + incr_1 + aCount + + +774 + 409 -772 - 417 +773 + 368 test Default @@ -666,11 +695,11 @@ Default -778 - 384 +840 + 381 -778 - 448 +839 + 394 control_m3p1 Gate @@ -684,11 +713,11 @@ 389 597 -1319 - 597 +1441 + 604 -1318 - 231 +1441 + 199 control_div2 Gate @@ -702,14 +731,14 @@ 3 587 -1214 - 588 +1307 + 586 -1213 - 546 +1307 + 528 -GraphGOTO +GraphGOTO_2 label_begin__NB label_begin NB @@ -718,7 +747,7 @@ 7 -GraphGOTO +GraphGOTO_2 label_begin__KB label_begin KB -- 2.39.2