A cellular automaton for modelling territories