AnyLogic
Expand
Font size

Class OptQuestOptimization

    java.lang.Object
      com.opttek.optquest.COptQuestOptimization
        com.anylogic.engine.OptQuestOptimization
All Implemented Interfaces:
IOptimization

public class OptQuestOptimization
extends com.opttek.optquest.COptQuestOptimization
implements IOptimization
A wrapper class for COptQuestOptimization. Sets the OptQuest license, and defines two methods: Evaluate and MonitorStatus so that they call experiment's evaluate() and monitor() correspondingly. Also takes care of stopping the optimization if interrupted flag was set.

Field Summary

Fields inherited from class com.opttek.optquest.COptQuestOptimization

DEMOLICENSE, OCLP_COEFFOFSEMI1VAR, OCLP_COEFFOFSEMI2VAR, OCLP_COEFFOFVAR, OCLP_IRR, OCLP_MAX, OCLP_MEAN, OCLP_MEDIAN, OCLP_MIN, OCLP_NONE, OCLP_NPV, OCLP_PBP, OCLP_PERCENTILE, OCLP_PROBABILITY, OCLP_SEMI1STDDEV, OCLP_SEMI1VARIANCE, OCLP_SEMI2STDDEV, OCLP_SEMI2VARIANCE, OCLP_STDDEV, OCLP_VARIANCE, REPLTERM_MAXREPLICATIONS, REPLTERM_METCONFIDENCE, REPLTERM_NEEDMORE, REPLTERM_NOTNEARBEST, REPLTERM_REMOVEBYRAS, REPLTERM_STILLINRAS, TERM_AUTOSTOP, TERM_BESTFOUND, TERM_CANNOTGENERATE, TERM_EXCEPTION, TERM_FACTORIESDONE, TERM_INFEASIBLE, TERM_LP, TERM_MAXITERATIONS, TERM_MAXTIME, TERM_NOTSTARTED, TERM_OPTIMALFOUND, TERM_RUNNING, TERM_USERSTOPPED

Constructor Summary

ConstructorDescription
OptQuestOptimization() 

Method Summary

Modifier and TypeMethodDescription
voidaddObjective(IObjective objective) 
voidaddParameter(IVariable variable) 
voidaddPostConstraint(IPostConstraint requirement) 
voidaddPreConstraint(IPreConstraint constraint) 
voidaddSuggestedSolution() 
voidcontinueOptimization() 
IBinaryVariablecreateBooleanVariable() 
IContinuousVariablecreateContinuousVariable() 
IDiscreteVariablecreateDiscreteVariable() 
IObjectivecreateObjective() 
IPostConstraintcreatePostConstraint() 
IPreConstraintcreatePreConstraint() 
voidEvaluate(com.opttek.optquest.COptQuestSolution solution) 
intgetBestIteration() 
doublegetBestObjectiveValue() 
ObjectgetBestParam(IVariable variable) 
doublegetBestParamValue(IVariable variable) 
intgetBestReplicationsNumber() 
intgetCurrentIteration() 
doublegetCurrentObjectiveValue() 
ObjectgetCurrentParam(IVariable variable) 
doublegetCurrentParamValue(IVariable variable) 
intgetCurrentReplication() 
intgetMaximumIterations() 
intgetNumberOfCompletedIterations() 
intgetSelectedNthBestIteration()
Deprecated.
doublegetSelectedNthBestObjectiveValue()
Deprecated.
ObjectgetSelectedNthBestParam(IVariable variable)
Deprecated.
doublegetSelectedNthBestParamValue(IVariable variable)
Deprecated.
intgetSelectedNthBestReplicationsNumber()
Deprecated.
booleanisBestSolutionFeasible() 
booleanisCurrentSolutionFeasible() 
booleanisLastReplication() 
booleanisSelectedNthBestSolutionFeasible() 
booleanisStarted() 
final booleanisUseReplications() 
voidMonitorStatus(com.opttek.optquest.COptQuestSolution sol) 
ThrowableperformParallel(boolean restart) 
ThrowableperformSerial(boolean restart) 
voidprepareRestart() 
voidselectNthBestSolution(int bestSolutionIndex)
Deprecated.
voidsetAutoStop(boolean stop) 
voidsetCurrentObjectiveValue(IObjective objective, double value) 
voidsetCurrentPostConstraintValue(IPostConstraint requirement, double value) 
voidsetCurrentPreConstraintValue(IPreConstraint constraint, double value) 
voidsetExperiment(ExperimentOptimization<?> experiment) 
voidsetFixedReplicationsNumber(int replicationsNumber) 
voidsetMaximumIterations(int numberOfIterations) 
voidsetParameterSuggestedValue(IVariable variable, Object value) 
voidsetPostConstraint(IPostConstraint requirement, double bound, ConstraintTypeEnum type) 
voidsetPreConstraint(IPreConstraint constraint, double bound, ConstraintTypeEnum type, String expression) 
voidsetUserControlledStop(boolean stop) 
voidsetUseReplications(boolean useReplications) 
voidsetVariableReplicationsNumber(int minimumReplications, int maximumReplications, ExperimentMultipleRuns.ConfidenceLevel confidenceLevel, double errorPercent) 
voidstopOptimization() 
voidvalidateInput() 

Methods inherited from class com.opttek.optquest.COptQuestOptimization

AddAdditionalReplicationsSolution, AddConstraint, AddConstraint, AddConstraint, AddDiscountRate, AddObjective, AddObjectiveFunction, AddPermutationGroup, AddPredictor, AddRankAndSelectionSolution, AddRequirement, AddRequirement, AddSelectionGroup, AddSuggestedSolution, AddVariable, ChangeVariableConstraint, CheckOptimization, CloseLogSetupFile, CloseSolutionLog, ContinueOptimize, CreateSolution, CreateSolutionSet, EfficientFrontier, EvaluateComplete, GetApproxSolutionSize, GetAutoStopCycles, GetAutoStopNumberSolutions, GetAutoStopPercentImprove, GetBestSolution, GetCheckDup, GetElapsedTime, GetEndingVarPrecision, GetEvaluateException, GetGradientAnalysis, GetIterationSolution, GetMaximumIterations, GetMaximumReplications, GetMaximumTime, GetMinimumReplications, GetName, GetNthBestSolution, GetNthEfficientFrontier, GetNumberEfficientFrontier, GetNumberofCompletedIterations, GetNumberOfFeasibleSolutions, GetNumberOfInfeasibleSolutions, GetNumberOfStringConstraints, GetObjective, GetObjPrecision, GetPatternFrontier, GetPatternFrontier, GetRegressionAnalysis, GetRejectNonLinear, GetRequirement, GetStartingVarPrecision, GetStringConstraint, GetTerminationReason, GetTerminationReasonString, GetUseCrossEntropy, GetUseInfeasibilityIndex, GetUserControlledStop, GetUserControlledVariableConstraint, GetUseReplications, GetVariable, GetVariables, GetVersion, IsAdditionalReplicationsMode, IsAutoStopByCycles, IsAutoStopByPercentImprovement, IsEnumerable, IsNthEfficientFrontierFeasible, IsRankAndSelectionMode, IsRunRepeatableEvaluation, IsStopped, LogSetup, LogSolutions, Optimize, OptimizeAdditional, RankAndSelect, Recalculate, RemoveConstraint, RemoveConstraint, RemoveRequirement, RunRepeatableEvaluations, SearchRestart, SetAdditionalIterations, SetAdditionalReplications, SetAdditionalReplicationsSolutions, SetAdditionalTime, SetAutoStopByCycles, SetAutoStopByPercentImprovement, SetAutoStopCycles, SetAutoStopNumberSolutions, SetAutoStopPercentImprove, SetCannotGenerateAsTermReason, SetCheckDup, SetDOEType, SetEndingVarPrecision, SetEvaluate, SetGradientAnalysis, SetLicenseID, SetMaximumIterations, SetMaximumReplications, SetMaximumTime, SetMetaHeuristic, SetMinimumReplications, SetName, SetObjPrecision, SetRandomSeed, SetRankAndSelectionCorrectProbability, SetRankAndSelectionIndifferenceZone, SetRankAndSelectionSolutions, SetRegressionAnalysis, SetRejectNonLinear, SetStartingVarPrecision, SetUseCrossEntropy, SetUseDOE, SetUseInfeasibilityIndex, SetUseMinimizeError, SetUseNeuralNetworkGenerator, SetUsePortfolioAlgorithms, SetUserControlledStop, SetUserControlledVariableConstraint, SetUseReplications, StopOnSuccessfulMILP, StopOptimization, UseEnglishOnly

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

OptQuestOptimization

public OptQuestOptimization()

Method Details

addPreConstraint

public void addPreConstraint(IPreConstraint constraint)
Specified by:
addPreConstraint in interface IOptimization

addObjective

public void addObjective(IObjective objective)
Specified by:
addObjective in interface IOptimization

addParameter

public void addParameter(IVariable variable)
Specified by:
addParameter in interface IOptimization

addPostConstraint

public void addPostConstraint(IPostConstraint requirement)
Specified by:
addPostConstraint in interface IOptimization

addSuggestedSolution

public void addSuggestedSolution()
Specified by:
addSuggestedSolution in interface IOptimization

continueOptimization

public void continueOptimization()
Specified by:
continueOptimization in interface IOptimization

Evaluate

public void Evaluate(com.opttek.optquest.COptQuestSolution solution)
              throws com.opttek.optquest.COptQuestException
Overrides:
Evaluate in class com.opttek.optquest.COptQuestOptimization
Throws:
com.opttek.optquest.COptQuestException

getBestIteration

public int getBestIteration()
Specified by:
getBestIteration in interface IOptimization

getBestObjectiveValue

public double getBestObjectiveValue()
Specified by:
getBestObjectiveValue in interface IOptimization

getBestParam

public Object getBestParam(IVariable variable)
Specified by:
getBestParam in interface IOptimization

getBestParamValue

public double getBestParamValue(IVariable variable)
Specified by:
getBestParamValue in interface IOptimization

getBestReplicationsNumber

public int getBestReplicationsNumber()
Specified by:
getBestReplicationsNumber in interface IOptimization

getCurrentIteration

public int getCurrentIteration()
Specified by:
getCurrentIteration in interface IOptimization

getCurrentObjectiveValue

public double getCurrentObjectiveValue()
Specified by:
getCurrentObjectiveValue in interface IOptimization

getCurrentParam

public Object getCurrentParam(IVariable variable)
Specified by:
getCurrentParam in interface IOptimization

getCurrentParamValue

public double getCurrentParamValue(IVariable variable)
Specified by:
getCurrentParamValue in interface IOptimization

getCurrentReplication

public int getCurrentReplication()
Specified by:
getCurrentReplication in interface IOptimization

getMaximumIterations

public int getMaximumIterations()
Specified by:
getMaximumIterations in interface IOptimization

getNumberOfCompletedIterations

public int getNumberOfCompletedIterations()
Specified by:
getNumberOfCompletedIterations in interface IOptimization

getSelectedNthBestIteration

@Deprecated
public int getSelectedNthBestIteration()
Deprecated.

getSelectedNthBestObjectiveValue

@Deprecated
public double getSelectedNthBestObjectiveValue()
Deprecated.

getSelectedNthBestParam

@Deprecated
public Object getSelectedNthBestParam(IVariable variable)
Deprecated.

getSelectedNthBestParamValue

@Deprecated
public double getSelectedNthBestParamValue(IVariable variable)
Deprecated.

getSelectedNthBestReplicationsNumber

@Deprecated
public int getSelectedNthBestReplicationsNumber()
Deprecated.

isBestSolutionFeasible

public boolean isBestSolutionFeasible()
Specified by:
isBestSolutionFeasible in interface IOptimization

isCurrentSolutionFeasible

public boolean isCurrentSolutionFeasible()
Specified by:
isCurrentSolutionFeasible in interface IOptimization

isLastReplication

public boolean isLastReplication()
Specified by:
isLastReplication in interface IOptimization

isSelectedNthBestSolutionFeasible

public boolean isSelectedNthBestSolutionFeasible()

isStarted

public boolean isStarted()
Specified by:
isStarted in interface IOptimization

isUseReplications

public final boolean isUseReplications()

MonitorStatus

public void MonitorStatus(com.opttek.optquest.COptQuestSolution sol)
                   throws com.opttek.optquest.COptQuestException
Overrides:
MonitorStatus in class com.opttek.optquest.COptQuestOptimization
Throws:
com.opttek.optquest.COptQuestException

performParallel

public Throwable performParallel(boolean restart)
Specified by:
performParallel in interface IOptimization

performSerial

public Throwable performSerial(boolean restart)
Specified by:
performSerial in interface IOptimization

prepareRestart

public void prepareRestart()
Specified by:
prepareRestart in interface IOptimization

selectNthBestSolution

@Deprecated
public void selectNthBestSolution(int bestSolutionIndex)
Deprecated.

setAutoStop

public void setAutoStop(boolean stop)
Specified by:
setAutoStop in interface IOptimization

setCurrentObjectiveValue

public void setCurrentObjectiveValue(IObjective objective,
 double value)
Specified by:
setCurrentObjectiveValue in interface IOptimization

setCurrentPostConstraintValue

public void setCurrentPostConstraintValue(IPostConstraint requirement,
 double value)
Specified by:
setCurrentPostConstraintValue in interface IOptimization

setExperiment

public void setExperiment(ExperimentOptimization<?> experiment)
Specified by:
setExperiment in interface IOptimization

setFixedReplicationsNumber

public void setFixedReplicationsNumber(int replicationsNumber)
Specified by:
setFixedReplicationsNumber in interface IOptimization

setMaximumIterations

public void setMaximumIterations(int numberOfIterations)
Specified by:
setMaximumIterations in interface IOptimization

setParameterSuggestedValue

public void setParameterSuggestedValue(IVariable variable,
 Object value)
Specified by:
setParameterSuggestedValue in interface IOptimization

setUserControlledStop

public void setUserControlledStop(boolean stop)
Specified by:
setUserControlledStop in interface IOptimization

setUseReplications

public void setUseReplications(boolean useReplications)

stopOptimization

public void stopOptimization()
Specified by:
stopOptimization in interface IOptimization

setPostConstraint

public void setPostConstraint(IPostConstraint requirement,
 double bound,
 ConstraintTypeEnum type)
Specified by:
setPostConstraint in interface IOptimization

setPreConstraint

public void setPreConstraint(IPreConstraint constraint,
 double bound,
 ConstraintTypeEnum type,
 String expression)
Specified by:
setPreConstraint in interface IOptimization

setVariableReplicationsNumber

public void setVariableReplicationsNumber(int minimumReplications,
 int maximumReplications,
 ExperimentMultipleRuns.ConfidenceLevel confidenceLevel,
 double errorPercent)

validateInput

public void validateInput()
Specified by:
validateInput in interface IOptimization

createObjective

public IObjective createObjective()
Specified by:
createObjective in interface IOptimization

createContinuousVariable

public IContinuousVariable createContinuousVariable()
Specified by:
createContinuousVariable in interface IOptimization

createDiscreteVariable

public IDiscreteVariable createDiscreteVariable()
Specified by:
createDiscreteVariable in interface IOptimization

createBooleanVariable

public IBinaryVariable createBooleanVariable()
Specified by:
createBooleanVariable in interface IOptimization

createPostConstraint

public IPostConstraint createPostConstraint()
Specified by:
createPostConstraint in interface IOptimization

createPreConstraint

public IPreConstraint createPreConstraint()
Specified by:
createPreConstraint in interface IOptimization

setCurrentPreConstraintValue

public void setCurrentPreConstraintValue(IPreConstraint constraint,
 double value)
Specified by:
setCurrentPreConstraintValue in interface IOptimization