]> SALOME platform Git repositories - modules/superv.git/blob - examples/GraphSyracuseC_Void.py
Salome HOME
Bug fix: don't set "Loading" state for MacroNodes in InitialState() function (called...
[modules/superv.git] / examples / GraphSyracuseC_Void.py
1
2 # Generated python file of Graph GraphSyracuseC_Void
3
4 from SuperV import *
5 # Graph creation 
6 GraphSyracuseC_Void = Graph( 'GraphSyracuseC_Void' )
7 print GraphSyracuseC_Void.SetName( 'GraphSyracuseC_Void' )
8 print GraphSyracuseC_Void.SetAuthor( 'JR' )
9 print GraphSyracuseC_Void.SetComment( 'Syracuse algorithm' )
10 GraphSyracuseC_Void.Coords( 0 , 0 )
11
12 # Creation of Nodes
13 test_ISEVEN = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
14 print test_ISEVEN.SetName( 'test_ISEVEN' )
15 print test_ISEVEN.SetAuthor( '' )
16 print test_ISEVEN.SetContainer( 'localhost/FactoryServer' )
17 print test_ISEVEN.SetComment( '' )
18 test_ISEVEN.Coords( 5 , 416 )
19 test_ISONE = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
20 print test_ISONE.SetName( 'test_ISONE' )
21 print test_ISONE.SetAuthor( '' )
22 print test_ISONE.SetContainer( 'localhost/FactoryServer' )
23 print test_ISONE.SetComment( '' )
24 test_ISONE.Coords( 7 , 232 )
25 m3p1 = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
26 print m3p1.SetName( 'm3p1' )
27 print m3p1.SetAuthor( '' )
28 print m3p1.SetContainer( 'localhost/FactoryServer' )
29 print m3p1.SetComment( '' )
30 m3p1.Coords( 180 , 417 )
31 div2 = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
32 print div2.SetName( 'div2' )
33 print div2.SetAuthor( '' )
34 print div2.SetContainer( 'localhost/FactoryServer' )
35 print div2.SetComment( '' )
36 div2.Coords( 435 , 7 )
37 div2_ISEVEN = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
38 print div2_ISEVEN.SetName( 'div2_ISEVEN' )
39 print div2_ISEVEN.SetAuthor( '' )
40 print div2_ISEVEN.SetContainer( 'localhost/FactoryServer' )
41 print div2_ISEVEN.SetComment( '' )
42 div2_ISEVEN.Coords( 619 , 191 )
43 div2_ISONE = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
44 print div2_ISONE.SetName( 'div2_ISONE' )
45 print div2_ISONE.SetAuthor( '' )
46 print div2_ISONE.SetContainer( 'localhost/FactoryServer' )
47 print div2_ISONE.SetComment( '' )
48 div2_ISONE.Coords( 616 , 6 )
49 incr = GraphSyracuseC_Void.Node( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
50 print incr.SetName( 'incr' )
51 print incr.SetAuthor( '' )
52 print incr.SetContainer( 'localhost/FactoryServer' )
53 print incr.SetComment( '' )
54 incr.Coords( 434 , 193 )
55
56 # Creation of intermediate Output variables and of links
57 test_ISEVENOutVoid = test_ISEVEN.Port( 'OutVoid' )
58 m3p1InVoid = GraphSyracuseC_Void.Link( test_ISEVENOutVoid , m3p1.Port( 'InVoid' ) )
59 m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' )
60 div2anEvenInteger = GraphSyracuseC_Void.Link( m3p1anEvenInteger , div2.Port( 'anEvenInteger' ) )
61 print div2anEvenInteger.AddCoord( 1 , 368 , 158 )
62 print div2anEvenInteger.AddCoord( 2 , 369 , 568 )
63 div2anInteger = div2.Port( 'anInteger' )
64 div2_ISONEanInteger = GraphSyracuseC_Void.Link( div2anInteger , div2_ISONE.Port( 'anInteger' ) )
65 div2_ISEVENanInteger = GraphSyracuseC_Void.Link( div2anInteger , div2_ISEVEN.Port( 'anInteger' ) )
66 print div2_ISEVENanInteger.AddCoord( 1 , 603 , 342 )
67 print div2_ISEVENanInteger.AddCoord( 2 , 603 , 158 )
68
69 # Creation of Input datas
70 test_ISEVENanInteger = test_ISEVEN.Input( 'anInteger' , 31)
71 test_ISONEanInteger = test_ISONE.Input( 'anInteger' , 31)
72 m3p1anOddInteger = m3p1.Input( 'anOddInteger' , 31)
73 div2InanEvenInteger = div2.Port( 'anEvenInteger' )
74 incraCount = incr.Input( 'aCount' , 0)
75
76 # Missing Input datas
77
78 # Creation of Output variables
79 test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' )
80 test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' )
81 div2_ISEVENBoolEven = div2_ISEVEN.Port( 'BoolEven' )
82 div2_ISONEBoolOne = div2_ISONE.Port( 'BoolOne' )
83 incraNewCount = incr.Port( 'aNewCount' )
84
85 GraphSyracuseC_Void.IsValid()
86
87 GraphSyracuseC_Void.ThreadsMax()
88
89 GraphSyracuseC_Void.LevelMax()
90
91 GraphSyracuseC_Void.GraphsNumber()
92
93 curM3P1 = m3p1.Input( 'anOddInteger' , 31 )
94 curtestISEVEN = test_ISEVEN.Input( 'anInteger' , curM3P1.ToAny() )
95 curtestISONE = test_ISONE.Input( 'anInteger' , curM3P1.ToAny() )
96
97 GraphSyracuseC_Void.IsExecutable()
98
99 GraphSyracuseC_Void.Start()
100
101 m3p1.Suspend()
102
103 div2_ISEVEN.SuspendDone()
104 div2_ISONE.SuspendDone()
105
106 test_ISEVEN.Resume()
107 test_ISONE.Resume()
108
109 # Attente de fin d'exécution de test
110 test_ISONE.DoneW()
111 test_ISEVEN.DoneW()
112
113 m3p1.SuspendedW()
114 incr.SuspendedW()
115 incr.SuspendDone()
116
117 # Etats et Threads des nodes
118 GraphSyracuseC_Void.PrintThreads()
119
120 BoolOne = int( test_ISONEBoolOne.ToString() )
121 BoolEven = int( test_ISEVENBoolEven.ToString() )
122 while BoolOne == 0 :
123     if BoolEven == 0 :
124         sts = div2_ISONE.ReRunAt('m3p1')
125         sts = incr.ReRun()
126         sts = m3p1.DoneW()
127         sts = incr.DoneW()
128         sts = incraCount.Input( int( incraNewCount.ToString() ) + 1 )
129         BoolEven = 1 
130         BoolOne = 0
131         Current = int( m3p1anEvenInteger.ToString() )
132         print "m3p1",Current,BoolEven
133     while BoolEven == 1 :
134         sts = incr.ReRun()
135         sts = div2.DoneW()
136         sts = div2_ISEVEN.DoneW()
137         sts = div2_ISONE.DoneW()
138         sts = incr.DoneW()
139         sts = incraCount.Input( incraNewCount.ToString() )
140         BoolOne = int( div2_ISONEBoolOne.ToString() )
141         BoolEven = int( div2_ISEVENBoolEven.ToString() )
142         Current = int( div2anInteger.ToString() )
143         print "div2",Current,BoolEven,BoolOne
144         if BoolEven == 1 :
145             div2InanEvenInteger.Input( Current )
146             sts = div2_ISONE.ReRunAt('div2')
147     sts = curM3P1.Input( Current )
148
149
150 GraphSyracuseC_Void.PrintThreads()
151 m3p1.Resume()
152 div2.Resume()
153 incr.Resume()
154 div2_ISONE.Resume()
155 div2_ISEVEN.Resume()
156 GraphSyracuseC_Void.DoneW()
157 print GraphSyracuseC_Void.State()
158 GraphSyracuseC_Void.PrintPorts()
159 GraphSyracuseC_Void.PrintThreads()
160