09.09.2014 Views

13th International Conference on Membrane Computing - MTA Sztaki

13th International Conference on Membrane Computing - MTA Sztaki

13th International Conference on Membrane Computing - MTA Sztaki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DCBA: Simulating populati<strong>on</strong> dynamics P systems with proporti<strong>on</strong>al object<br />

distributi<strong>on</strong><br />

Algorithm 4 SELECTION PHASE 1: DISTRIBUTION<br />

1: for j = 1 to m do ⊲ (For each envir<strong>on</strong>ment e j)<br />

2: Apply filters to table T j using C t, obtaining Tj t . The filters are applied as follows:<br />

a. Tj t ← T j<br />

b. Filter 1 (Tj t , C t).<br />

c. Filter 2 (Tj t , C t).<br />

d. Check mutual c<strong>on</strong>sistency for the blocks remaining in Tj t :<br />

• Create a vector MCj, t of order q (number of membranes in Π), with<br />

MCj(i) t = −1, 1 ≤ i ≤ q.<br />

• for each column B i,α,α ′ ,u,v in Tj t , do<br />

∗ if MCj(i) t = −1 then MCj(i) t ← α ′ .<br />

∗ else if MCj(i) t = α ′ then do nothing.<br />

∗ else store all the informati<strong>on</strong> about the inc<strong>on</strong>sistency.<br />

• if there was at least <strong>on</strong>e inc<strong>on</strong>sistency then report the informati<strong>on</strong><br />

about the error, and opti<strong>on</strong>ally halt the executi<strong>on</strong> (in case of not<br />

activating step 3.)<br />

e. Filter 3 (Tj t , C t).<br />

f. Tj,z t ← Tj<br />

t<br />

3: (OPTIONAL) Generate, from Tj t , sub-tables formed by sets of mutually<br />

c<strong>on</strong>sistent blocks, in a maximal way in Tj<br />

t (by the inclusi<strong>on</strong> relati<strong>on</strong>ship). This<br />

will produce a set of sub-tables Tj,k, t k = 1, . . . , s. Randomly select <strong>on</strong>e table from<br />

the set: Tj,z<br />

t<br />

4: a ← 1<br />

5: Ct a ← C t<br />

′<br />

6: repeat<br />

7: Add up the values of each row in Tj,z. t Filter the rows whose sum is 0.<br />

8: Each element of the table is divided by the sum of the values from the<br />

corresp<strong>on</strong>ding row.<br />

9: For each pair (o, i) and (x, e) ∈ Ct a , if the object in Ct a has multiplicity<br />

mult > 0, all the elements of the corresp<strong>on</strong>ding row in Tj,z t are multiplied by mult,<br />

by the corresp<strong>on</strong>ding value in Tj,z<br />

t (computed in the previous step), and by the<br />

original value in T j. That is, if in the positi<strong>on</strong> (X, Y ) of the table T j there is a not<br />

null value, and the corresp<strong>on</strong>ding object in the row X has multiplicity mult X,a,t<br />

in Ct a , then:<br />

T t j,z(X, Y ) = ⌊mult X,a,t · T t j,z(X, Y ) ·<br />

Tj,z(X, t Y )<br />

⌋ = ⌊mult X,a,t · (T j,z(X, t Y )) 2<br />

⌋<br />

RowSum X,t RowSum X,t<br />

10: For each block B (i.e., column) appearing (i.e. not filtered) in Tj,z, t calculate<br />

the minimum number of the previously calculated values, NB<br />

a ≥ 0. This is the<br />

number of times the block is going to be applied. This value is accumulated to the<br />

total calculated through the iterati<strong>on</strong> of the loop over a: B j sel<br />

← B j sel<br />

+ {B N B a }<br />

11: C a+1<br />

t ← Ct a − LHS(B) · NB a ⊲ (Delete the LHS of the block.)<br />

12: Filter 2 (Tj,z, t C a+1<br />

t )<br />

13: Filter 3 (Tj,z, t C a+1<br />

t )<br />

14: a ← a + 1<br />

15: until (a > A) ∨ (all the selected minimums in step 10 are 0)<br />

16: end for<br />

299

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!