private void update() {

		for (turn = 1; turn <= MAXTURNS; turn++) {
												
			while(isPaused) {
				try {
					Thread.sleep(100);
				} catch (InterruptedException e) {
					e.printStackTrace();
				}
			}
			
			for (Ant ant : ants) {
				if (ant.isAlive()) {
					if (ant.getResting() > 0) {
						ant.setResting(ant.getResting() - 1);
					} else {
						Position p = findAnt(ant.getId());
						Cell cell = cells[p.x][p.y];
						ant.getStateMachine().step(ant, cell);
					}
				}
			}
			calcScores();
			
			//update GUI in EDT
			Runnable updateDisplay = new Runnable() {
				public void run() { screen.update(); }
			};
			SwingUtilities.invokeLater(updateDisplay);
			//screen.update();					
						
			//	dump turn info
			if (logger != null) {
				//	Choose which turns to log here
				if (turn < 10000)
					logger.logTurn();
			}

			//	Variable speed
			try {
				Thread.sleep(sleepAmount);
			} catch (InterruptedException e) {
				// Surely not a problem...
				e.printStackTrace();
			}	
		}
	}