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.

Using a kernel P system to solve the 3-Col problem<br />

/* Array of instances for membranes of type Compartment1 */<br />

Compartment1 c1Cells[ ];<br />

/* Array of instances for membranes of type Compartment2 */<br />

Compartment2 c2Cells[ ];<br />

int stepCount = 0;<br />

while(envir<strong>on</strong>ment is empty AND stepCount < MaxNumberOfSteps) {<br />

foreach(membraneInstance m in c1Cells) {<br />

/* Execute process1 which c<strong>on</strong>tains all rules<br />

defined for a membrane of type "Compartment1"<br />

*/<br />

run process1(m);<br />

}<br />

foreach(membraneInstance m in c2Cells) {<br />

/* Execute process2 which c<strong>on</strong>tains all rules<br />

defined for a membrane of type "Compartment2"<br />

*/<br />

run process2(m);<br />

}<br />

}<br />

/* Wait until all processes complete<br />

i.e. when all applicable rules were executed.<br />

*/<br />

wait();<br />

/* Computati<strong>on</strong>al step complete */<br />

stepCount++;<br />

Fig. 1. Pseudo code illustrating the kP system model implementati<strong>on</strong> into Promela<br />

253

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

Saved successfully!

Ooh no, something went wrong!