public ArrayList<Command> addPossibleCommandsForAgent(AgentInState aPos,
			State currentState) {
		ArrayList<Command> possibleCommands = new ArrayList<Command>();

		Field agentLocationInPlan = aPos.f;

		// Commented because we are not interested in move commands at current
		// time.
		for (dir direction : dir.values()) {

			if (neighbourFreeInState(
					agentLocationInPlan.neighbors[direction.ordinal()],
					currentState)) {
				possibleCommands.add(new Command(direction));
			}

			// Find possible pull and push commands
			for (dir d : dir.values()) {

				// we cannot pull a box forward in the box's direction
				if (d != direction
						&& neighbourIsBoxOfSameColourInState(
								agentLocationInPlan.neighbors[d.ordinal()],
								currentState, aPos)
						&& neighbourFreeInState(
								agentLocationInPlan.neighbors[direction
										.ordinal()],
								currentState)) {

					possibleCommands.add(new Command("Pull", direction, d));
				}

				// We cannot push a box backwards in the agents direction
				if (d != Constants.oppositeDir(direction)
						&& neighbourIsBoxOfSameColourInState(
								agentLocationInPlan.neighbors[d.ordinal()],
								currentState, aPos)
						&& neighbourFreeInState(
								agentLocationInPlan.neighbors[d.ordinal()].neighbors[direction
										.ordinal()], currentState)) {
					possibleCommands.add(new Command("Push", d, direction));
				}

			}

		}

		return possibleCommands;
	}