@Override
	public Object execute(TransitionSystem ts, Unifier un, Term[] terms) throws Exception {
		WorldModel model = ((MartianArch) ts.getUserAgArch()).getModel();
		Graph graph = model.getGraph();

		Vertex myPosition = model.getMyVertex();

		List<Vertex> notProbedNeighbors = graph.returnNotProbedNeighbors(myPosition);
		if (null == notProbedNeighbors || notProbedNeighbors.isEmpty()) {
			// go to the least visited vertex
			int nextMove = graph.returnLeastVisitedNeighbor(myPosition.getId());
			if (nextMove == -1) {
				return un.unifies(terms[0], ASSyntax.createString("none"));
			}
			String vertex = Percept.VERTEX_PREFIX + nextMove;
			return un.unifies(terms[0], ASSyntax.createString(vertex));
		} else {
			Collections.shuffle(notProbedNeighbors);
			for (Vertex notProbedNeighbor : notProbedNeighbors) {
				if (notProbedNeighbor.getTeam().equals(WorldModel.myTeam)
						&& !model.hasActiveOpponentOnVertex(notProbedNeighbor)) {
					String vertex = Percept.VERTEX_PREFIX + notProbedNeighbor.getId();
					return un.unifies(terms[0], ASSyntax.createString(vertex));
				}
			}
			for (Vertex notProbedNeighbor : notProbedNeighbors) {
				if (!model.hasActiveOpponentOnVertex(notProbedNeighbor)) {
					String vertex = Percept.VERTEX_PREFIX + notProbedNeighbor.getId();
					return un.unifies(terms[0], ASSyntax.createString(vertex));
				}
			}
			// go to the least visited vertex
			int nextMove = graph.returnLeastVisitedNeighbor(myPosition.getId());
			if (nextMove == -1) {
				return un.unifies(terms[0], ASSyntax.createString("none"));
			}
			String vertex = Percept.VERTEX_PREFIX + nextMove;
			return un.unifies(terms[0], ASSyntax.createString(vertex));
		}
	}