예제 #1
0
  @Override
  public boolean terminate() {
    if (stagnation > CONFIG.get(STAGNATION)) {
      if (reset) {
        policy.initialise(graph);
        stagnation = 0;
        reset = false;
      } else {
        return true;
      }
    }

    return super.terminate();
  }
예제 #2
0
  @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);
  }
예제 #3
0
 @Override
 public void update(Archive<RuleList> archive) {
   super.update(archive);
   policy.update(graph, archive.highest());
 }