Package ai.libs.jaicore.timing
Class TimedComputation
- java.lang.Object
-
- ai.libs.jaicore.timing.TimedComputation
-
public abstract class TimedComputation extends java.lang.ObjectThis class is the single-thread pendant to asynchronous computations realized with Futures
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Tcompute(java.util.concurrent.Callable<T> callable, org.api4.java.algorithm.Timeout timeout, java.lang.String reasonToLogOnTimeout)static voidcomputeWithTimeout(org.api4.java.algorithm.Timeout timeout, java.lang.Runnable runnable)static voidcomputeWithTimeoutInParallel(int numCPUs, org.api4.java.algorithm.Timeout timeout, java.util.List<java.lang.Runnable> taskList)
-
-
-
Method Detail
-
compute
public static <T> T compute(java.util.concurrent.Callable<T> callable, org.api4.java.algorithm.Timeout timeout, java.lang.String reasonToLogOnTimeout) throws java.util.concurrent.ExecutionException, org.api4.java.algorithm.exceptions.AlgorithmTimeoutedException, java.lang.InterruptedException- Throws:
java.util.concurrent.ExecutionExceptionorg.api4.java.algorithm.exceptions.AlgorithmTimeoutedExceptionjava.lang.InterruptedException
-
computeWithTimeout
public static void computeWithTimeout(org.api4.java.algorithm.Timeout timeout, java.lang.Runnable runnable) throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
computeWithTimeoutInParallel
public static void computeWithTimeoutInParallel(int numCPUs, org.api4.java.algorithm.Timeout timeout, java.util.List<java.lang.Runnable> taskList) throws java.lang.InterruptedException- Throws:
java.lang.InterruptedException
-
-