protected Tuple<Double, Double> maximax(Graph g, int depth,int nextId) {
		Tuple<Double,Double> best = new Tuple<Double,Double>(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY);
		if (cutoffTest(depth,g))
			return Eval(g);
		Yazidi a = (Yazidi) getAgent(nextId, g);
		if((a._foodCarried<0)||(a.get_goal()==a._location))
			return maximax(g, depth-1, 1 - nextId);
		for(ActionGraph ag: g.getActions(getAgent(nextId, g))){//TODO CHECK
			Graph g2 = ag.getG();
			Action child = ag.getAct();
			Tuple<Double,Double> score  = maximax(g2.apply(child,getAgent(nextId, g2)), depth - 1, 1 - nextId);
			if(worseThan(best, score,nextId,g)){
				best = score;
			}
		}
		return best;
	}