- java.lang.Object
-
- org.ojalgo.optimisation.service.OptimisationService
-
public final class OptimisationService extends java.lang.ObjectBasic usage:- Put optimisation problems on the solve queue by calling
putOnQueue(Sense, byte[], FileFormat) - Check the status of the optimisation by calling
getStatus(String)– is itOptimisationService.Status.DONEor stillOptimisationService.Status.PENDING? - Get the result of the optimisation by calling
getResult(String)– whenOptimisationService.Status.DONE
- Put optimisation problems on the solve queue by calling
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classOptimisationService.Problemstatic classOptimisationService.Status
-
Field Summary
Fields Modifier and Type Field Description private static Optimisation.ResultFAILEDprivate intmyNumberOfWorkersprivate Optimisation.OptionsmyOptimisationOptionsprivate ProcessingServicemyProcessingServiceprivate java.util.concurrent.BlockingQueue<OptimisationService.Problem>myQueueprivate ForgetfulMap<java.lang.String,Optimisation.Result>myResultCacheprivate ForgetfulMap<java.lang.String,OptimisationService.Status>myStatusCache
-
Constructor Summary
Constructors Constructor Description OptimisationService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static Optimisation.ResultdoOptimise(Optimisation.Sense sense, byte[] contents, ExpressionsBasedModel.FileFormat format)private voiddoOptimise(OptimisationService.Problem problem)private static java.lang.StringgenerateKey()Optimisation.ResultgetResult(java.lang.String key)OptimisationService.StatusgetStatus(java.lang.String key)static ServiceIntegrationnewIntegration(java.lang.String host)Optimisation.Resultoptimise(Optimisation.Sense sense, byte[] contents, ExpressionsBasedModel.FileFormat format)java.lang.StringputOnQueue(Optimisation.Sense sense, byte[] contents, ExpressionsBasedModel.FileFormat format)
-
-
-
Field Detail
-
FAILED
private static final Optimisation.Result FAILED
-
myNumberOfWorkers
private final int myNumberOfWorkers
-
myOptimisationOptions
private final Optimisation.Options myOptimisationOptions
-
myProcessingService
private final ProcessingService myProcessingService
-
myQueue
private final java.util.concurrent.BlockingQueue<OptimisationService.Problem> myQueue
-
myResultCache
private final ForgetfulMap<java.lang.String,Optimisation.Result> myResultCache
-
myStatusCache
private final ForgetfulMap<java.lang.String,OptimisationService.Status> myStatusCache
-
-
Method Detail
-
newIntegration
public static ServiceIntegration newIntegration(java.lang.String host)
-
doOptimise
private static Optimisation.Result doOptimise(Optimisation.Sense sense, byte[] contents, ExpressionsBasedModel.FileFormat format) throws RecoverableCondition
- Throws:
RecoverableCondition
-
generateKey
private static java.lang.String generateKey()
-
getResult
public Optimisation.Result getResult(java.lang.String key)
-
getStatus
public OptimisationService.Status getStatus(java.lang.String key)
-
optimise
public Optimisation.Result optimise(Optimisation.Sense sense, byte[] contents, ExpressionsBasedModel.FileFormat format)
-
putOnQueue
public java.lang.String putOnQueue(Optimisation.Sense sense, byte[] contents, ExpressionsBasedModel.FileFormat format) throws RecoverableCondition
- Throws:
RecoverableCondition
-
doOptimise
private void doOptimise(OptimisationService.Problem problem)
-
-