Looking for some tips on a Simulation Project!
Afficher commentaires plus anciens
Hi, I'm creating a MATLAB code for a Parasite & Food simulation which is similar to a random walk. In this Simulation; the Food agents remain stationary, scattered randomly around a domain, and the Parasites take steps around this domain. The parasite can move onto a food cell and 'eat the food' (food cell is changes to a parasite cell), or move to an empty cell. (two parasites can't occupy the same cell)
So this is my problem:
In previous random walk simulations I've used a logical array where 1 = a particle, and 0 = free space. In this case I now need three different objects: Free space, Parasites, and Food. So it seems a logical array would no longer work. The best current idea I have is to create an array and somehow set : 0 = free space, 1 = food and 2 = parasite, but I'm wondering if there is a better way of doing this?
any tips or pointers would be great, thanks!
Réponse acceptée
Plus de réponses (1)
Nicola Bombace
le 12 Oct 2018
1 vote
Enumerations can be a good way to mark your states.
1 commentaire
Ben Shaw
le 12 Oct 2018
Catégories
En savoir plus sur Food Sciences dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!