src/agents/AntAgent.java
/**
	 * Mode where ant looks for nest with food
	 */
Mode where ant looks for nest with food
Mode where ant looks for nest with food
private void returnToNest() {
		Collections.shuffle(location.getNeighbors());
		Collections.sort(location.getNeighbors(), new Comparator<Cell>() {
			/**
			 * Comparator to sort list by pheromone levels
			 */
			@Override
			public int compare(Cell o1, Cell o2) {
				if(((AntCell) o2).getNestPheromones() > ((AntCell) o1).getNestPheromones()) {
					return 1;
				} else if (((AntCell) o2).getNestPheromones() == ((AntCell) o1).getNestPheromones()) {
					return 0;
				} else {
					return -1;
				}
			}
		});
		moveToFirst(location.getNeighbors());
	}
private void returnToNest ( ) { Collections . shuffle ( location . getNeighbors ( ) ) ; Collections . sort ( location . getNeighbors ( ) , new Comparator < Cell > ( ) { /**
			 * Comparator to sort list by pheromone levels
			 */ @ Override public int compare ( Cell o1 , Cell o2 ) { if ( ( ( AntCell ) o2 ) . getNestPheromones ( ) > ( ( AntCell ) o1 ) . getNestPheromones ( ) ) { return 1 ; } else if ( ( ( AntCell ) o2 ) . getNestPheromones ( ) == ( ( AntCell ) o1 ) . getNestPheromones ( ) ) { return 0 ; } else { return - 1 ; } } } ) ; moveToFirst ( location . getNeighbors ( ) ) ; }
Mode where ant looks for nest with food
Mode where ant looks for nest with food