1 package net.sf.openrocket.optimization;
3 import java.util.concurrent.Callable;
6 * A Callable that computes the value of a function at a specific point.
8 * @author Sampo Niskanen <sampo.niskanen@iki.fi>
10 public class FunctionCallable implements Callable<Double> {
12 private final Function function;
13 private final Point point;
18 * @param function the function to evaluate
19 * @param point the point at which to evaluate the function
21 public FunctionCallable(Function function, Point point) {
22 this.function = function;
27 * Evaluate the function and return the result.
30 public Double call() throws InterruptedException {
31 return function.evaluate(point);