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.

L. Cienciala, L. Ciencialová, M. Perdek<br />

Fig. 2. The initial c<strong>on</strong>figurati<strong>on</strong> of Π 2<br />

find another food source, the agent would be ”forgetting” the n<strong>on</strong>-empty food<br />

source it had already found, and it would start searching again.<br />

This situati<strong>on</strong> can be solved by adding a new agent to the 2D P col<strong>on</strong>y. This<br />

new agent is not an explorer. Its programs allow it to unblock the agents which<br />

had stopped next to an empty food source. An alternative soluti<strong>on</strong> is to add<br />

priorities to the program. We associate every program with a natural number.<br />

During the computati<strong>on</strong>al step the program with the highest priority is chosen<br />

to be executed.<br />

5 Implementati<strong>on</strong> of 2D P Col<strong>on</strong>y Simulator<br />

The simulati<strong>on</strong> envir<strong>on</strong>ment has been written in Java and it allows us to load,<br />

save and create simulati<strong>on</strong>s using XML markup language. The simulati<strong>on</strong> file is<br />

loaded using XML parser and it creates a tree structure of objects using DOM<br />

and JAXP. These objects represent parameters of the simulati<strong>on</strong>, which c<strong>on</strong>tain<br />

a descripti<strong>on</strong> of the envir<strong>on</strong>ment and agents in this envir<strong>on</strong>ment. The informati<strong>on</strong><br />

describing the envir<strong>on</strong>ment includes parameters such as speed of simulati<strong>on</strong>,<br />

the size and the c<strong>on</strong>tents of the envir<strong>on</strong>ment. The speed of the simulati<strong>on</strong> determines<br />

the time interval between the steps of the simulati<strong>on</strong>. The envir<strong>on</strong>ment<br />

and its c<strong>on</strong>tents are represented by a two-dimensi<strong>on</strong>al array of objects which is<br />

168

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

Saved successfully!

Ooh no, something went wrong!