// 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;
package org.avmframework.localsearch;


public class GeometricSearch extends PatternThenEliminationSearch {

  public GeometricSearch() {}

  public GeometricSearch(int accelerationFactor) {
    super(accelerationFactor);
  }

  protected void performEliminationSearch(int left, int right) throws TerminationException {
    while (left < right) {
      int mid = (int) Math.floor((left + right) / 2.0);
      int midRight = mid + 1;

      var.setValue(mid);
      ObjectiveValue midObjVal = objFun.evaluate(vector);

      var.setValue(midRight);
// 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/GeometricSearch.java
import org.avmframework.TerminationException;
import org.avmframework.objective.ObjectiveValue;

package org.avmframework.localsearch;


public class GeometricSearch extends PatternThenEliminationSearch {

  public GeometricSearch() {}

  public GeometricSearch(int accelerationFactor) {
    super(accelerationFactor);
  }

  protected void performEliminationSearch(int left, int right) throws TerminationException {
    while (left < right) {
      int mid = (int) Math.floor((left + right) / 2.0);
      int midRight = mid + 1;

      var.setValue(mid);
      ObjectiveValue midObjVal = objFun.evaluate(vector);

      var.setValue(midRight);
      ObjectiveValue midRightObjVal = objFun.evaluate(vector);