src/agents/AntAgent.java
/**
	 * Updates hasFood and pheromone levels for relevant cell
	 */
Updates hasFood and pheromone levels for relevant cell
Updates hasFood and pheromone levels for relevant cell
public void updateState() {
		if(hasFood) {
			returnToNest();
		} else {
			findFood();
		}
		if(location.getState() == FOOD) {		
			hasFood = true;
			location.reduceDurability();
			location.setFoodPheromones(FOOD);
		} else if(location.getState() == NEST) { 		
			hasFood = false;
			location.setNestPheromones(FOOD);
		} else {
			location.setNestPheromones(Math.max(location.getNestPheromones(), getMaxNestPheromones() * PHEROMONE_DIFFUSION));
			location.setFoodPheromones(Math.max(location.getFoodPheromones(), getMaxFoodPheromones() * PHEROMONE_DIFFUSION));
		}
	}
public void updateState ( ) { if ( hasFood ) { returnToNest ( ) ; } else { findFood ( ) ; } if ( location . getState ( ) == FOOD ) { hasFood = true ; location . reduceDurability ( ) ; location . setFoodPheromones ( FOOD ) ; } else if ( location . getState ( ) == NEST ) { hasFood = false ; location . setNestPheromones ( FOOD ) ; } else { location . setNestPheromones ( Math . max ( location . getNestPheromones ( ) , getMaxNestPheromones ( ) * PHEROMONE_DIFFUSION ) ) ; location . setFoodPheromones ( Math . max ( location . getFoodPheromones ( ) , getMaxFoodPheromones ( ) * PHEROMONE_DIFFUSION ) ) ; } }
Updates hasFood and pheromone levels for relevant cell
Updates hasFood and pheromone levels for relevant cell
// FOOOOD // AT NEST