Print

Print


Hi Sean,
You ask me to be more specific to my problem, so I have revised the three images.

In each of them image one is at the point prior to filling the last clearly available cell, green marks the start point and yellow the head of the snake. The arrows indicate the path followed to reach this point.
Image two shows the head has filled the last available slot in its path and the von Neumann neighborhood for the next step are all occupied and I believe that the spawning should stop at this point.
Image three is from two steps further running, on the first step the cyan cell at coordinates 1,6 is not identified in the printout. At the second step a child is spawned in coordinates 1,7.

I need to create a method like this:

private void checkIfFinished(Bag vNObjects) {
		// TODO Auto-generated method stub
		int len = vNObjects.size();
		for (int j=0; j<len; j++) {
			/* Still some thought required.
			 * This method should check if all of the 
			 * von Neumann neighbours are occupied for a particular
			 * central cell then if they are the run should pause.
			 * Count the occupied cells and print.
                         * Clear the grid and restart a new run.
			 */
		   	
			return ;
		}

I will be grateful if you could point me in the direction of the following in MASON:

1. Identify that each cell in the von Neumann is occupied and then pause the schedule.
    I can output the data required to an external file.
2. How to clear the grid.
3. Restart a new run and repeat doing this ten times.

Kind regards

Stewart Aitken