// Path: src/main/java/org/avmframework/TerminationException.java
// public class TerminationException extends Exception {}
// 
// Path: src/main/java/org/avmframework/objective/ObjectiveValue.java
// public abstract class ObjectiveValue<T extends ObjectiveValue> implements Comparable<T> {
// 
//   public abstract boolean isOptimal();
// 
//   public boolean betterThan(T other) {
//     return compareTo(other) > 0;
//   }
// 
//   public boolean sameAs(T other) {
//     return compareTo(other) == 0;
//   }
// 
//   public boolean worseThan(T other) {
//     return compareTo(other) < 0;
//   }
// }


import org.avmframework.TerminationException;
import org.avmframework.objective.ObjectiveValue;
      dir = -1;
    } else if (rightBetter) {
      dir = 1;
    } else {
      dir = 0;
    }

    // set num and the variable according to the best edge
    num += dir * modifier;
    var.setValue(num);

    // set last and next objective values
    last = initial;
    if (dir == -1) {
      next = left;
    } else if (dir == 1) {
      next = right;
    } else if (dir == 0) {
      next = initial;
    }

    return dir != 0;
  }

  protected void patternSearch() throws TerminationException {

    while (next.betterThan(last)) {
      last = next;

      // make the pattern move
// Path: src/main/java/org/avmframework/TerminationException.java
// public class TerminationException extends Exception {}
// 
// Path: src/main/java/org/avmframework/objective/ObjectiveValue.java
// public abstract class ObjectiveValue<T extends ObjectiveValue> implements Comparable<T> {
// 
//   public abstract boolean isOptimal();
// 
//   public boolean betterThan(T other) {
//     return compareTo(other) > 0;
//   }
// 
//   public boolean sameAs(T other) {
//     return compareTo(other) == 0;
//   }
// 
//   public boolean worseThan(T other) {
//     return compareTo(other) < 0;
//   }
// }


// Path: src/main/java/org/avmframework/localsearch/PatternSearch.java
import org.avmframework.TerminationException;
import org.avmframework.objective.ObjectiveValue;

      dir = -1;
    } else if (rightBetter) {
      dir = 1;
    } else {
      dir = 0;
    }

    // set num and the variable according to the best edge
    num += dir * modifier;
    var.setValue(num);

    // set last and next objective values
    last = initial;
    if (dir == -1) {
      next = left;
    } else if (dir == 1) {
      next = right;
    } else if (dir == 0) {
      next = initial;
    }

    return dir != 0;
  }

  protected void patternSearch() throws TerminationException {

    while (next.betterThan(last)) {
      last = next;

      // make the pattern move
      modifier *= accelerationFactor;