public class FF2 extends Heuristic { public FF2(){super("FF2");} public double evaluate(Variable v){ int d_i = v.futureDegree(); int m_i = v.getCurrentDomainSize(); int m = v.getCsp().getM();; double p2 = v.getCsp().getP2(); double t1 = (1.0 - Math.pow(p2,(double)m)); double t2 = Math.pow(t1,(double)d_i); double t3 = 1.0 - t2; double h = Math.pow(t3,(double)m_i); h = 1.0/h; v.setHeuristicValue(h); return h; } }