@Override public boolean terminate() { if (stagnation > CONFIG.get(STAGNATION)) { if (reset) { policy.initialise(graph); stagnation = 0; reset = false; } else { return true; } } return super.terminate(); }
@Override public void initialise() { super.initialise(); policy = new LevelPheromonePolicy(); policy.initialise(graph); reset = true; // (initial) heuristic of the whole dataset Instance[] instances = Instance.newArray(dataset.size()); Instance.markAll(instances, RULE_COVERED); INITIAL_HEURISTIC = CONFIG.get(DEFAULT_HEURISTIC).compute(graph, dataset, instances); }