1 package net.sf.openrocket.optimization.general;
3 import java.util.Collection;
7 * A FunctionCache that allows queuing points to be computed in the background,
8 * waiting for specific points to become computed or aborting the computation of
11 * @author Sampo Niskanen <sampo.niskanen@iki.fi>
13 public interface ParallelFunctionCache extends FunctionCache {
16 * Queue a list of function evaluations at the specified points.
18 * @param points the points at which to evaluate the function.
20 public void compute(Collection<Point> points);
23 * Queue function evaluation for the specified point.
25 * @param point the point at which to evaluate the function.
27 public void compute(Point point);
30 * Wait for a collection of points to be computed. After calling this method
31 * the function values are available by calling XXX
33 * @param points the points to wait for.
34 * @throws InterruptedException if this thread was interrupted while waiting.
36 public void waitFor(Collection<Point> points) throws InterruptedException;
39 * Wait for a point to be computed. After calling this method
40 * the function values are available by calling XXX
42 * @param point the point to wait for.
43 * @throws InterruptedException if this thread was interrupted while waiting.
45 public void waitFor(Point point) throws InterruptedException;
49 * Abort the computation of the specified point. If computation has ended,
50 * the result is stored in the function cache anyway.
52 * @param points the points to abort.
53 * @return a list of the points that have been computed anyway
55 public List<Point> abort(Collection<Point> points);
59 * Abort the computation of the specified point. If computation has ended,
60 * the result is stored in the function cache anyway.
62 * @param point the point to abort.
63 * @return <code>true</code> if the point has been computed anyway, <code>false</code> if not.
65 public boolean abort(Point point);