Package com.anylogic.engine
- Nested Class Summary
- Nested classes/interfaces inherited from class com.anylogic.engine.ExperimentMultipleRuns
- Nested classes/interfaces inherited from class com.anylogic.engine.Experiment
- Field Summary
- Fields inherited from class com.anylogic.engine.ExperimentMultipleRuns
- Fields inherited from class com.anylogic.engine.Experiment
- Fields inherited from class com.anylogic.engine.Utilities
- Fields inherited from class com.anylogic.engine.Presentable
- Fields inherited from interface com.anylogic.engine.AgentConstants
- Fields inherited from interface com.anylogic.engine.EnvironmentConstants
- Constructor Summary
- Method Summary
- Methods inherited from class com.anylogic.engine.ExperimentMultipleRuns
- Methods inherited from class com.anylogic.engine.ExperimentRunFast
- Methods inherited from class com.anylogic.engine.Experiment
- Methods inherited from class com.anylogic.engine.Utilities
- Methods inherited from class com.anylogic.engine.Presentable
- Methods inherited from class java.lang.Object
- Constructor Detail
- Method Detail
- isCommandEnabled
- getProgress
- doesOptimizationExist
- getMaximumIterations
- getCurrentIteration
- getNumberOfCompletedIterations
- isCurrentSolutionBest
- getCurrentReplication
- getCurrentObjectiveValue
- getCurrentParamValue
- isCurrentSolutionFeasible
- getBestIteration
- getBestReplicationsNumber
- getBestObjectiveValue
- getBestParamValue
- isBestSolutionFeasible
- getBestFeasibleIteration
- getBestFeasibleReplicationsNumber
- getBestFeasibleObjectiveValue
- getBestFeasibleParamValue
- selectNthBestSolution
- getSelectedNthBestIteration
- getSelectedNthBestReplicationsNumber
- getSelectedNthBestObjectiveValue
- getSelectedNthBestParamValue
- isSelectedNthBestSolutionFeasible
- getOptimization
- setObjectiveMinimize
- setObjectiveMaximize
- setParameterVariableName
- setParameterVariableLowerBound
- setParameterVariableUpperBound
- setParameterVariableSuggestedValue
- setParameterVariableStepSize
- addParameterVariable
- addSuggestedSolution
- setLinearConstraintRHS
- addLinearConstraintVariable
- addConstraint
- setConstraintEquation
- addConstraint
- setRequirementLowerBound
- setRequirementUpperBound
- addRequirement
- setCurrentObjectiveValue
- setCurrentRequirementValue_xjal
- stopOptimization
- setRejectNonLinear
- setUseReplications
- isUseReplications
- setFixedReplicationsNumber
- setVariableReplicationsNumber
- setMaximumIterations
- setAutoStop
- setUserControlledStop
- isLastReplication
- setupRootParameters
- setLogBufferLength
- createOptimization
- createOptimization
- java.lang.Object
-
- com.anylogic.engine.Presentable
-
- com.anylogic.engine.Utilities
-
- com.anylogic.engine.Experiment<ROOT>
-
- com.anylogic.engine.ExperimentRunFast<ROOT>
-
- com.anylogic.engine.ExperimentMultipleRuns<ROOT>
-
- com.anylogic.engine.ExperimentOptimization<ROOT>
- Type Parameters:
ROOT
- class of top-level agent
- All Implemented Interfaces:
AgentConstants
,EnvironmentConstants
,java.io.Serializable
public abstract class ExperimentOptimization<ROOT extends Agent> extends ExperimentMultipleRuns<ROOT>
Experiment used to search for optimal solutions. Uses OptQuest optimizer. To
use this experiment you need to subclass from it and define the methods
setupRootParameters(Agent, boolean)
which needs to retrieve the parameter values suggested by OptQuest and
Experiment.onEngineFinished()
to set the objective according to
simulation output.- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
ExperimentMultipleRuns.ConfidenceLevel
Experiment.Command, Experiment.State
CONFIDENCE_LEVEL_80, CONFIDENCE_LEVEL_90, CONFIDENCE_LEVEL_95, CONFIDENCE_LEVEL_98, CONFIDENCE_LEVEL_99, CONFIDENCE_LEVEL_99_9
ERROR, FINISHED, IDLE, modelExecutionCommandQueue, mutexModelActionQueue, OPEN_RESULTS, OPEN_SNAPSHOT, PAUSE, PAUSED, PLEASE_WAIT, RUN, RUNNING, SAVE_RESULTS, SAVE_SNAPSHOT, STEP, STOP
AM, APRIL, AUGUST, CUSTOM_DISTRIBUTION_INTERPOLATION_LINEAR, CUSTOM_DISTRIBUTION_INTERPOLATION_NONE, CUSTOM_DISTRIBUTION_INTERPOLATION_STEP, DECEMBER, FEBRUARY, FRIDAY, infinity, JANUARY, JULY, JUNE, LENGTH_UNIT_CENTIMETER, LENGTH_UNIT_FOOT, LENGTH_UNIT_INCH, LENGTH_UNIT_KILOMETER, LENGTH_UNIT_METER, LENGTH_UNIT_MILE, MARCH, MAY, MONDAY, NOVEMBER, OCTOBER, PM, SATURDAY, SEPTEMBER, SUNDAY, THURSDAY, TIME_UNIT_DAY, TIME_UNIT_HOUR, TIME_UNIT_MILLISECOND, TIME_UNIT_MINUTE, TIME_UNIT_MONTH, TIME_UNIT_SECOND, TIME_UNIT_WEEK, TIME_UNIT_YEAR, TUESDAY, UNDECIMBER, WEDNESDAY
ALIGNMENT_CENTER, ALIGNMENT_LEFT, ALIGNMENT_RIGHT, ARROW_FILLED, ARROW_NONE, ARROW_THIN, CAD_ANTIALIASING, CAD_INVERTED, LINE_STYLE_DASHED, LINE_STYLE_DOTTED, LINE_STYLE_SOLID, SHAPE_DRAW_2D, SHAPE_DRAW_2D3D, SHAPE_DRAW_3D
AGENT_ORIENTATION_FRONT, AGENT_ORIENTATION_LEFT, AGENT_ORIENTATION_REAR, AGENT_ORIENTATION_RIGHT, ALL, ALL_CONNECTED, ALL_NEIGHBORS, AREA_ACCESS_RESTRICTION_BY_CAPACITY, AREA_ACCESS_RESTRICTION_BY_CONDITION, AREA_ACCESS_RESTRICTION_BY_SCHEDULE, AREA_ACCESS_RESTRICTION_BY_THROUGHPUT, AREA_ACCESS_RESTRICTION_MANUAL, CENTIMETER, CONVEYOR_BACKWARD, CONVEYOR_CUSTOM_STATION_AGENT_LOCATION_CENTER, CONVEYOR_CUSTOM_STATION_AGENT_LOCATION_NEAR_CONVEYOR, CONVEYOR_CUSTOM_STATION_AGENT_LOCATION_RANDOM, CONVEYOR_FORWARD, CONVEYOR_SIMPLE_STATION_DELAY_TYPE_MANUAL, CONVEYOR_SIMPLE_STATION_DELAY_TYPE_TIMEOUT, CONVEYOR_TYPE_BELT, CONVEYOR_TYPE_CELL, CONVEYOR_TYPE_ROLLER, CUBIC_METER, CUBIC_METER_PER_SECOND, CUSTOM_COLOR_SCHEME, DAY, DEG_PER_SECOND, DEGREE, DENSITY_VALUE_MAX, DENSITY_VALUE_MEAN, EAST, ELEVATOR_DIRECTION_DOWN, ELEVATOR_DIRECTION_NONE, ELEVATOR_DIRECTION_UP, ELEVATOR_DOORS_FRONT, ELEVATOR_DOORS_FRONT_REAR, ELEVATOR_MOVEMENT_BY_SPEED, ELEVATOR_MOVEMENT_BY_TIME_PER_FLOOR, ESCALATOR_STAY_ALL, ESCALATOR_WALK_ALL, ESCALATOR_WALK_ON_LEFT_SIDE, ESCALATOR_WALK_ON_RIGHT_SIDE, EVENT_TIMEOUT_MODE_CYCLIC, EVENT_TIMEOUT_MODE_ONCE, EVENT_TIMEOUT_MODE_USER, EXCEEDED_QUEUE_CROWD_ROUND_AT_THE_END, EXCEEDED_QUEUE_EXTEND_TO_THE_FREE_SPACE, EXT_AGENT_CONTINUOUS, EXT_AGENT_DISCRETE, EXT_AGENT_GIS, EXT_AGENT_INTERACTIVE, EXT_AGENT_NETWORK, EXT_ENTITY, EXT_ENVIRONMENT_CONTINUOUS, EXT_ENVIRONMENT_DISCRETE, EXT_ENVIRONMENT_GIS, EXT_ENVIRONMENT_INTERACTIVE, EXT_SPACE, FLOW_STATISTICS_BOTH, FLOW_STATISTICS_LEFT, FLOW_STATISTICS_RIGHT, FOOT, FPM, FPS, FPS_SQ, HOUR, INCH, JIB_CRANE_CAT_HEAD, JIB_CRANE_FLAT_TOP, JIB_CRANE_INDUSTRIAL, JIB_CRANE_MOVEMENT_CONCURRENT, JIB_CRANE_MOVEMENT_STEP_BY_STEP, KILOGRAM, KILOGRAM_PER_SECOND, KILOMETER, KN, KPH, LIFT_PLATFORM_FLAT, LIFT_PLATFORM_ROLLER, LIFT_SELECTION_MODE_COMPARISON, LIFT_SELECTION_MODE_FIFO, LIFT_SELECTION_MODE_PRIORITY, LINEAR_COLOR_SCHEME, LITER, LITER_PER_SECOND, LOGARITHMIC_COLOR_SCHEME, METER, MILE, MILLIMETER, MILLISECOND, MINUTE, MONTH, MPH, MPS, MPS_SQ, NAUTICAL_MILE, NORTH, NORTHEAST, NORTHWEST, OBJECT_3D_INTERNAL_LIGHTING_GLOBAL, OBJECT_3D_INTERNAL_LIGHTING_INSIDE, OBJECT_3D_INTERNAL_LIGHTING_OFF, OBJECT_3D_XYZ_AXIS_ORDER, OBJECT_3D_YZX_AXIS_ORDER, OBJECT_3D_ZXY_AXIS_ORDER, OIL_BARREL, OIL_BARREL_PER_SECOND, OVERHEAD_CRANE_BRIDGE, OVERHEAD_CRANE_GANTRY, OVERHEAD_CRANE_GIRDER_DOUBLE_TIE, OVERHEAD_CRANE_GIRDER_SINGLE_FLAT, OVERHEAD_CRANE_MOVEMENT_CONCURRENT, OVERHEAD_CRANE_MOVEMENT_INDEPENDENT_HOIST, OVERHEAD_CRANE_MOVEMENT_STEP_BY_STEP, PALLET_RACK_LEFT_TO_RIGHT, PALLET_RACK_NO_DIRECTION, PALLET_RACK_RIGHT_TO_LEFT, PALLET_RACK_SINGLE_AISLE_LEFT, PALLET_RACK_SINGLE_AISLE_RIGHT, PALLET_RACK_TWO_AISLES, PALLET_RACK_TWO_PALLET_RACKS, PARKING_LOT_PARALLEL, PARKING_LOT_PERPENDICULAR, PATH_CONVEYOR, PATH_DASHEDLINE, PATH_LINE, PATH_RAILROAD, PATH_ROAD, PEDESTRIAN_MAP_TYPE, PER_DAY, PER_HOUR, PER_MILLISECOND, PER_MINUTE, PER_MONTH, PER_SECOND, PER_WEEK, PER_YEAR, POSITION_CHOICE_ARRANGED, POSITION_CHOICE_BY_ATTRACTORS, POSITION_CHOICE_RANDOM, RACK_PLACEMENT_BACK_TO_BACK, RACK_PLACEMENT_STAND_ALONE, RACK_TYPE_DRIVE_IN, RACK_TYPE_FIFO_FLOW, RACK_TYPE_LIFO_FLOW, RACK_TYPE_SELECTIVE, RAD_PER_SECOND, RADIAN, RAILWAY_SWITCH_ALL_TO_ALL, RAILWAY_SWITCH_DOUBLE_SLIP, RAILWAY_SWITCH_SINGLE_SLIP, RANDOM, RANDOM_CONNECTED, RANDOM_NEIGHBOR, ROAD_LEFT_HAND, ROAD_LINE_DOUBLE, ROAD_LINE_DOUBLE_DASHED, ROAD_LINE_SINGLE, ROAD_LINE_SINGLE_DASHED, ROAD_RIGHT_HAND, RPM, SECOND, SERVICE_GROUP_BEHAVIOR_DEPENDS_ON_INCOMING_GROUP, SERVICE_GROUP_BEHAVIOR_SAME_FOR_ALL_GROUPS, SERVICE_GROUP_INDIVIDUAL_SERVING, SERVICE_GROUP_ONE_MEMBER_IS_SERVED_OTHERS_WAIT_IN_AREA, SERVICE_GROUP_ONE_MEMBER_IS_SERVED_OTHERS_WAIT_IN_QUEUE, SERVICE_QUEUE_CLOSEST_NON_EMPTY, SERVICE_QUEUE_CLOSEST_STRICT, SERVICE_QUEUE_CUSTOM, SERVICE_QUEUE_LONGEST, SERVICE_QUEUE_NEXT_ROUND_ROBIN, SERVICE_QUEUE_PRIORITY, SERVICE_TYPE_LINEAR, SERVICE_TYPE_POINT, SIGNAL_GREEN, SIGNAL_NONE, SIGNAL_RED, SIGNAL_YELLOW, SIMPLE_STATION_LOADING_MODE_AFTER_UNLOADING, SIMPLE_STATION_LOADING_MODE_SIMULTANEOUS_WITH_UNLOADING, SIMPLE_STATION_PROCESSING_WHEN_AGENT_ENTERS, SIMPLE_STATION_PROCESSING_WHEN_CAPACITY_FULL, SOUTH, SOUTHEAST, SOUTHWEST, SPACE_CONTINUOUS, SPACE_CONTINUOUS_2D, SPACE_DISCRETE, SPACE_DISCRETE_2D, SPACE_GIS, SPACE_UNDEFINED, SQ_CENTIMETER, SQ_FOOT, SQ_INCH, SQ_KILOMETER, SQ_METER, SQ_MILE, SQ_MILLIMETER, SQ_NAUTICAL_MILE, SQ_YARD, TON, TON_PER_SECOND, TRANSPORTER_MAP_TYPE, TURN, TURN_STATION_MODE_ANGLE, TURN_STATION_MODE_ORIENTATION, WALL_FILL_HATCHING, WALL_FILL_NONE, WALL_FILL_SOLID, WEEK, WEST, WINDOW_3D_NAVIGATION_FULL, WINDOW_3D_NAVIGATION_LIMITED_TO_Z_ABOVE_ZERO, WINDOW_3D_NAVIGATION_NONE, WINDOW_3D_NAVIGATION_ROTATION_ONLY, YARD, YEAR
LAYOUT_ARRANGED, LAYOUT_RANDOM, LAYOUT_RING, LAYOUT_SPRING_MASS, LAYOUT_USER_DEFINED, NEIGHBORHOOD_EUCLIDEAN, NEIGHBORHOOD_MOORE, NETWORK_ALL_IN_RANGE, NETWORK_RANDOM, NETWORK_RING_LATTICE, NETWORK_SCALE_FREE, NETWORK_SMALL_WORLD, NETWORK_USER_DEFINED
ExperimentOptimization() |
Creates the experiment, a new simulation engine, and a new optimizer that
will be used throughout the whole experiment execution.
|
ExperimentOptimization(boolean allowParallelEvaluations) |
Same as
ExperimentOptimization() but allows to disable
parallel evaluations on multicore/multiprocessor systems
(which are enabled by default) |
Constructor | Description |
---|
void |
addConstraint(com.opttek.optquest.COptQuestConstraint constraint) |
Adds the constraint defined by the input parameter to the optimization
This is optimization setup method, user should not call it |
void |
addConstraint(com.opttek.optquest.COptQuestStringConstraint constraint) |
Adds the string constraint defined by the input parameter to the
optimization
This is optimization setup method, user should not call it |
void |
addLinearConstraintVariable(com.opttek.optquest.COptQuestConstraint constraint,
com.opttek.optquest.COptQuestVariable variable,
double coefficient) |
Adds a variable and its coefficient to the linear expression
This method is called for each variable that is used in the left hand side expression For example, the constraint 2*Var1 + 3*Var2 + 1.5*Var3 <= 100 would call
addLinearConstraintVariable(Var1,2), addLinearConstraintVariable(Var2, 3)
and addLinearConstraintVariable(Var3,1.5)This is optimization setup method, user should not call it |
void |
addParameterVariable(com.opttek.optquest.COptQuestVariable variable) |
Adds the variable defined by the input parameter to the optimization
This is optimization setup method, user should not call it |
void |
addRequirement(com.opttek.optquest.COptQuestRequirement requirement) |
Adds the requirement defined by the input parameter to the optimization
This is optimization setup method, user should not call it |
void |
addSuggestedSolution() |
This method signals the completion of a suggested solution definition.
setParameterVariableSuggestedValue(COptQuestVariable, double) is used to set a
value for each variable.This method signals a value has been set for each variable. The solution is added to the set of suggested solution and will be one of the first solutions evaluated if the optimization has not started. If the optimization is running, the suggested solution will be one of the next solutions to be evaluated This is optimization setup method, user should not call it |
static com.opttek.optquest.COptQuestOptimization |
createOptimization(Engine engine) |
Creates and returns new OptQuest optimization instance for Custom Experiment
This method should only be used in custom experiment code This method is designed for use in the AnyLogic Professional only |
static com.opttek.optquest.COptQuestOptimization |
createOptimization(Engine engine,
OptimizationCallback callback) |
Creates and returns new OptQuest optimization instance for Custom
Experiment with objective function defined in a free form using
evaluate
method of a special callback.
|
boolean |
doesOptimizationExist() |
Deprecated.
since AnyLogic version 8 this method is deprecated and no more needed, assuming that it always returns
true . |
int |
getBestFeasibleIteration() |
Deprecated.
call
isBestSolutionFeasible() and check its result:if it returns true , use getBestIteration() ;otherwise there is no best feasible iteration |
double |
getBestFeasibleObjectiveValue() |
Deprecated.
call
isBestSolutionFeasible() and check its result:if it returns true , use getBestObjectiveValue() ;otherwise there is no best feasible solution |
double |
getBestFeasibleParamValue(com.opttek.optquest.COptQuestVariable optimizationParameterVariable) |
Deprecated.
call
isBestSolutionFeasible() and check its result:if it returns true , use getBestParamValue(COptQuestVariable) ;otherwise there is no best feasible solution |
int |
getBestFeasibleReplicationsNumber() |
Deprecated.
call
isBestSolutionFeasible() and check its result:if it returns true , use getBestReplicationsNumber() ;otherwise there is no best feasible solution |
int |
getBestIteration() |
Returns the iteration that resulted in the best solution thus far
(solution may be infeasible) |
double |
getBestObjectiveValue() |
Returns the value of the objective function for the best solution found
thus far
Returned value may be infeasible |
double |
getBestParamValue(com.opttek.optquest.COptQuestVariable optimizationParameterVariable) |
Returns the value of the given optimization parameter variable for the
best solution found thus far
(solution may be infeasible) |
int |
getBestReplicationsNumber() |
Returns the number of replications that were run for the best solution
(solution may be infeasible) Ensure replications are used ( isUseReplications() ) before calling
this method |
int |
getCurrentIteration() |
Returns the current value of iteration counter
|
double |
getCurrentObjectiveValue() |
Returns the value of the objective function for the current solution
|
double |
getCurrentParamValue(com.opttek.optquest.COptQuestVariable optimizationParameterVariable) |
Returns the value of the given optimization parameter variable for the
current solution
|
int |
getCurrentReplication() |
Returns the replication number for the current solution being evaluated
Ensure replications are used ( isUseReplications() ) before calling
this method |
int |
getMaximumIterations() |
Returns the number of iterations set by
setMaximumIterations(int) |
int |
getNumberOfCompletedIterations() |
Returns the current value of iteration counter
|
com.opttek.optquest.COptQuestOptimization |
getOptimization() |
Returns the optimization engine.
|
double |
getProgress() |
Returns the progress of the experiment: a number between 0 and 1
corresponding to the part of the experiment completed so far (based on
iteration count or time limit), or
-1 if this cannot be calculated. |
int |
getSelectedNthBestIteration() |
Returns the iteration number for the Nth best solution, where the Nth
best solution is identified by the method
selectNthBestSolution(int) |
double |
getSelectedNthBestObjectiveValue() |
Returns the objective value for the Nth best solution, identified by the
method
selectNthBestSolution(int) |
double |
getSelectedNthBestParamValue(com.opttek.optquest.COptQuestVariable optimizationParameterVariable) |
Used to retrieve the value of the variable for the solution that produced
the Nth best objective value
The Nth best solution is identified by calling selectNthBestSolution(int) |
int |
getSelectedNthBestReplicationsNumber() |
Returns the number of replications for the Nth best solution, where the
Nth best solution is identified by the method
selectNthBestSolution(int) Ensure replications are used ( isUseReplications() ) before calling
this method |
boolean |
isBestSolutionFeasible() |
Returns
true if the best solution satisfies all
constraints and requirements |
boolean |
isCommandEnabled(Experiment.Command cmd) |
Checks if a command can be executed.
|
boolean |
isCurrentSolutionBest() |
Returns
true if current solution is the best one at this
moment |
boolean |
isCurrentSolutionFeasible() |
Returns
true if current solution satisfies all
constraints and requirements |
boolean |
isLastReplication() |
Return
true if we have run the last replication for the current solutionThis is optimization setup method, user should not call it |
boolean |
isSelectedNthBestSolutionFeasible() |
Returns
true if nth best solution satisfies all
constraints and requirements |
boolean |
isUseReplications() |
Returns
true if optimization uses replications |
void |
selectNthBestSolution(int bestSolutionIndex) |
Called by the user to identify the Nth best soluiton.
Subsequent calles to getSelectedNthBestObjectiveValue() and
getSelectedNthBestParamValue(COptQuestVariable) methods use this
setting to identify the solution. |
void |
setAutoStop(boolean stop) |
Sets the auto stop option.
If the input parameter is true , auto stop is turned on. |
void |
setConstraintEquation(com.opttek.optquest.COptQuestStringConstraint constraint,
java.lang.String equation) |
Sets the mathematical expression that defines the constraint
This is optimization setup method, user should not call it |
void |
setCurrentObjectiveValue(double value) |
Used to set the value of the objective for the current solution.
|
void |
setCurrentRequirementValue_xjal(com.opttek.optquest.COptQuestRequirement requirement,
double value) |
Used to set the value of the requirement for the current solution.
|
void |
setFixedReplicationsNumber(int replicationsNumber) |
Sets experiment to use a fixed number of replications.
No confidence testing is to be used For confidence testing use ExperimentMultipleRuns.setVariableReplicationsNumber(int, int, ConfidenceLevel, double) This is setup method, user should not call it |
void |
setLinearConstraintRHS(com.opttek.optquest.COptQuestConstraint constraint,
double value) |
Sets the right hand side value of a linear constraint
This is optimization setup method, user should not call it |
void |
setLogBufferLength(int length) |
|
void |
setMaximumIterations(int numberOfIterations) |
Sets the number of iterations the optimization should perform before
stopping.
|
void |
setObjectiveMaximize() |
Sets the goal of the optimization to maximize the objective value
This is optimization setup method, user should not call it |
void |
setObjectiveMinimize() |
Sets the goal of the optimization to minimize the objective value
This is optimization setup method, user should not call it |
void |
setParameterVariableLowerBound(com.opttek.optquest.COptQuestVariable variable,
double value) |
Sets lower bound size for optimization parameter variable
This is optimization setup method, user should not call it |
void |
setParameterVariableName(com.opttek.optquest.COptQuestVariable variable,
java.lang.String name) |
Assigns a name to the variable
Names must be alphanumeric and cannot be a function name This is optimization setup method, user should not call it |
void |
setParameterVariableStepSize(com.opttek.optquest.COptQuestDiscreteVariable variable,
double value) |
Sets step size for optimization parameter variable
Used for discrete variables This is optimization setup method, user should not call it |
void |
setParameterVariableSuggestedValue(com.opttek.optquest.COptQuestVariable variable,
double value) |
Allows the user to suggest a solution by setting a suggested value for
each variable
addSuggestedSolution() indicates the suggested solution is
complete and should be added to the set of solutions to be evaluated.This is optimization setup method, user should not call it |
void |
setParameterVariableUpperBound(com.opttek.optquest.COptQuestVariable variable,
double value) |
Sets upper bound size for optimization parameter variable
This is optimization setup method, user should not call it |
void |
setRejectNonLinear(boolean reject) |
Directs the OptQuest Engine to reject solutions that violate non-linear
constraints without performing simulation.
Non-linear constraints can be checked for feasibility before the simulation. |
void |
setRequirementLowerBound(com.opttek.optquest.COptQuestRequirement requirement,
double value) |
Sets the lower bound of requirement to the input value
This is optimization setup method, user should not call it |
void |
setRequirementUpperBound(com.opttek.optquest.COptQuestRequirement requirement,
double value) |
Sets the upper bound of requirement to the input value
This is optimization setup method, user should not call it |
abstract void |
setupRootParameters(ROOT root,
boolean callOnChangeActions) |
Is called to setup parameters of top-level agent.
|
void |
setUserControlledStop(boolean stop) |
Indicates the user will stop the optimization by calling the
stopOptimization() methodThis is optimization setup method, user should not call it |
void |
setUseReplications(boolean useReplications) |
Sets optimization to use replications
This is optimization setup method, user should not call it |
void |
setVariableReplicationsNumber(int minimumReplications,
int maximumReplications,
ExperimentMultipleRuns.ConfidenceLevel confidenceLevel,
double errorPercent) |
Sets experiment to stop replications after the minimum replications when
the confidence level is reached (i.e.
|
void |
stopOptimization() |
Stops the currently running optimization
This is optimization setup method, user should not call it |
Modifier and Type | Method | Description |
---|
getEngine, getMutexRead_xjal, getMutexWrite_xjal, getParallelEvaluatorsCount, getRunCount, getSimulationProgress_xjal, getStep, onAfterExperiment, onAfterIteration, onDestroy_xjal, registerExperimentHost_xjal
getRunTimeSeconds, getState, pause, run, step, stop
addExecutionListener, close, createRoot, destroy_xjal, error, errorInModel, getCommandLineArguments, getExperimentHost, getName, getSnapshotFileName, getWindowHeight, getWindowWidth, initDefaultRandomNumberGenerator, internalFillConfig, isLoadRootFromSnapshot, onBeforeSimulationRun, onDestroy, onEngineFinished, onError, onError, removeExecutionListener, reset, setCommandLineArguments_xjal, setLoadRootFromSnapshot, setName, setup, setupEngine, warning, warning
addToDate, addToDate, atan2fast, bernoulli, bernoulli, beta, beta, beta, beta, beta, binomial, binomial, binomial, binomial, binomial, briefInfoOn, castNumberTypes, castTypes, castTypesBack, cauchy, cauchy, cauchy, chi2, chi2, chi2, copyToClipboard, copyToClipboard, copyToClipboard, createTableElementDatabaseBuilder, createTrajectoryGIS, createURL_xjal, date, dateToTime, day, deleteFrom, difference, difference, differenceInCalendarUnits, differenceInCalendarUnits, differenceInDateUnits, differenceInDateUnits, differenceInDateUnits, differenceInDateUnits, dirToAngle, dropTime, erlang, erlang, erlang, error, error, error, errorInModel, errorInModel, errorInModel, executeAction, executeExpression, executeExpression, executeStatement, exponential, exponential, exponential, exponential, exponential, exponential, findExistingFile, format, format, format, format, format, format, format, formatAmountUnits, formatDayOfWeek, formatFlowRateUnits, formatGeoHeading, formatLatitude, formatLengthUnits, formatLengthUnits, formatLongitude, formatMonth, formatSpeedUnits, formatTimeInterval, gamma, gamma, gamma, gamma, gamma, gamma_frac, gammaLog, geometric, geometric, getAmPm, getAmPm, getCanonicalPath, getDatabaseConnection, getDateWithTimeNextTo, getDayOfMonth, getDayOfMonth, getDayOfWeek, getDayOfWeek, getDayOfYear, getDefaultRandomGenerator, getDistance, getDistance, getDistanceFromPointToLine, getDistanceFromPointToLineSq, getDistanceFromPointToSegment, getDistanceFromPointToSegment, getDistanceFromPointToSegmentSq, getDistanceFromPointToSegmentSq, getDistanceGIS, getDistanceGIS, getDistanceSq, getDistanceSq, getFullName, getHour, getHour, getHourOfDay, getHourOfDay, getLength, getLength, getLengthSq, getLengthSq, getMillisecond, getMillisecond, getMinute, getMinute, getMonth, getMonth, getName, getNearestPointOnSegment, getNearestPointOnSegment, getPerformanceParallelWorkersCount_xjal, getRandom, getRandom, getResult, getSecond, getSecond, getTime, getTimeoutToNextTime, getYear, getYear, gumbel1, gumbel1, gumbel2, gumbel2, hour, hypergeometric, hypergeometric, initializeRadians, insertInto, inspectOf, inspectOfLink_xjal, isFinite, isLineIntersectingLine, isLineIntersectingRectangle, isLoggingClassToDB, isLoggingToDB, isPointInsideRay, isPointInsideRectangle, isPointInsideSegment, isPointOnTheSameLine, isRayIntersectingSegment, joinArrays_xjal, laplace, laplace, layoutTypeToString, limit, limit, limitMax, limitMax, limitMin, limitMin, logarithmic, logarithmic, logistic, logistic, lognormal, lognormal, logToDB, logToDB, logToDB, logToDB, millisecond, minute, month, negativeBinomial, negativeBinomial, negativeBinomial, negativeBinomial, normal, normal, normal, normal, normal, normal, pareto, pareto, pareto, pert, pert, poisson, poisson, poisson, poisson, prepareBeforeExperimentStart_xjal, prepareStatement, pulse, pulseTrain, quantum, ramp, random, randomColor, randomFalse, randomFalse, randomFrom, randomFrom, randomFrom, randomFrom, randomFrom, randomFrom, randomlyCreate, randomlyCreate, randomlyCreate, randomlyCreate, randomTrue, randomTrue, randomWhere, randomWhere, randomWhere, randomWhere, rayleigh, rayleigh, rayleigh, roundToDecimal, roundToInt, second, selectAndDoForEach, selectArrayOfDouble, selectArrayOfInt, selectExists, selectExists, selectFirstValue, selectFirstValue, selectFirstValue, selectFirstValue, selectFrom, selectResultSet, selectTableFunction, selectUniqueValue, selectUniqueValue, selectUniqueValue, selectUniqueValue, selectValues, selectValues, setDefaultRandomGenerator, shuffle, sqlGetObject, sqlGetObject, sqlGetObject, sqlGetObject, sqlSetObject, sqr, step, time, time, timeToDate, toDate, toDate, toDate, toDateInMillis, toLatitude, toLongitude, toModelRate, toModelTime, toRateUnits, toStringAlignedNameValues, toTimeout, toTimeout, toTimeoutInCalendar, toTimeUnits, trace, trace, traceln, traceln, traceln, traceln, traceln, traceToDB, traceToDB, triangular, triangular, triangular, triangular, triangular, triangularAV, triangularAV, uniform, uniform, uniform, uniform, uniform, uniform_discr, uniform_discr, uniform_discr, uniform_pos, uniform_pos, update, week, weibull, weibull, weibull, weibull, weibull, xidz, year, zidz
createElementDescriptors, executeShapeControlAction, executeShapeControlAction, executeShapeControlAction, executeShapeControlAction, executeShapeControlAction, executeShapeControlAction, getElementDesciptors, getElementProperty, getExperiment, getModelElementsShape, getPresentation, getPresentationShape, getShapeControlDefaultValueBoolean, getShapeControlDefaultValueDouble, getShapeControlDefaultValueInt, getShapeControlDefaultValueString, getViewAreas, iconContains, onSelectionChanged_xjal, onShapeClick, onShapeGroupDraw, presentationContains, readCustomData, updateShapeDynamicProperties, writeCustomData
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public ExperimentOptimization()
Creates the experiment, a new simulation engine, and a new optimizer that
will be used throughout the whole experiment execution. A user-controlled
objective is added to the optimizer at this time.
public ExperimentOptimization(boolean allowParallelEvaluations)
Same as
ExperimentOptimization()
but allows to disable
parallel evaluations on multicore/multiprocessor systems
(which are enabled by default)- Parameters:
allowParallelEvaluations
- iffalse
, the iterations/replications of experiment will be performed sequentially- See Also:
ExperimentMultipleRuns.getParallelEvaluatorsCount()
public boolean isCommandEnabled(Experiment.Command cmd)
Description copied from class:
Experiment
Checks if a command can be executed. The possible command ids are:
OPEN_RESULTS, SAVE_RESULTS, OPEN_SNAPSHOT, SAVE_SNAPSHOT, RUN, STEP
PAUSE, STOP.
- Overrides:
isCommandEnabled
in classExperiment<ROOT extends Agent>
- Parameters:
cmd
- the command id- Returns:
true
if the command can be executed,false
otherwise
public final double getProgress()
Returns the progress of the experiment: a number between 0 and 1
corresponding to the part of the experiment completed so far (based on
iteration count or time limit), or
-1
if this cannot be calculated.- Overrides:
getProgress
in classExperimentMultipleRuns<ROOT extends Agent>
- Returns:
- the progress of the experiment
@Deprecated public boolean doesOptimizationExist()
Deprecated.
since AnyLogic version 8 this method is deprecated and no more needed, assuming that it always returns
true
.public int getMaximumIterations()
Returns the number of iterations set by
setMaximumIterations(int)
- Specified by:
getMaximumIterations
in classExperimentMultipleRuns<ROOT extends Agent>
- Returns:
- the total number of iterations
public int getCurrentIteration()
Returns the current value of iteration counter
- Specified by:
getCurrentIteration
in classExperimentMultipleRuns<ROOT extends Agent>
- Returns:
- the current value of iteration counter
public int getNumberOfCompletedIterations()
Returns the current value of iteration counter
- Overrides:
getNumberOfCompletedIterations
in classExperimentMultipleRuns<ROOT extends Agent>
- Returns:
- the current value of iteration counter
public boolean isCurrentSolutionBest()
Returns
true
if current solution is the best one at this
moment- Returns:
true
if current solution is the best one at this moment,false
otherwise
public int getCurrentReplication()
Returns the replication number for the current solution being evaluated
Ensure replications are used (
Ensure replications are used (
isUseReplications()
) before calling
this method- Specified by:
getCurrentReplication
in classExperimentMultipleRuns<ROOT extends Agent>
- Returns:
- the number of replications run thus far
public double getCurrentObjectiveValue()
Returns the value of the objective function for the current solution
- Returns:
- the value of the objective function for the current solution
public double getCurrentParamValue(com.opttek.optquest.COptQuestVariable optimizationParameterVariable)
Returns the value of the given optimization parameter variable for the
current solution
- Returns:
- the value of the given optimization parameter variable for the current solution
public boolean isCurrentSolutionFeasible()
Returns
true
if current solution satisfies all
constraints and requirements- Returns:
true
if current solution satisfies all constraints and requirements,false
otherwise
public int getBestIteration()
Returns the iteration that resulted in the best solution thus far
(solution may be infeasible)
(solution may be infeasible)
- Returns:
- the iteration that resulted in the best solution
- See Also:
isBestSolutionFeasible()
public int getBestReplicationsNumber()
Returns the number of replications that were run for the best solution
(solution may be infeasible)
Ensure replications are used (
(solution may be infeasible)
Ensure replications are used (
isUseReplications()
) before calling
this method- Returns:
- the number of replications that were run for the best solution
(solution may be infeasible) - See Also:
isBestSolutionFeasible()
public double getBestObjectiveValue()
Returns the value of the objective function for the best solution found
thus far
Returned value may be infeasible
Returned value may be infeasible
- Returns:
- the value of the objective function for the best solution found thus far
- See Also:
isBestSolutionFeasible()
public double getBestParamValue(com.opttek.optquest.COptQuestVariable optimizationParameterVariable)
Returns the value of the given optimization parameter variable for the
best solution found thus far
(solution may be infeasible)
(solution may be infeasible)
- Returns:
- the value of the given optimization parameter variable for the best solution found thus far
- See Also:
isBestSolutionFeasible()
public boolean isBestSolutionFeasible()
Returns
true
if the best solution satisfies all
constraints and requirements- Returns:
true
if the best solution satisfies all constraints and requirements,false
otherwise- See Also:
getBestObjectiveValue()
@Deprecated public int getBestFeasibleIteration()
Deprecated.
call
if it returns
otherwise there is no best feasible iteration
isBestSolutionFeasible()
and check its result:if it returns
true
, use getBestIteration()
;otherwise there is no best feasible iteration
Returns the iteration that resulted in the best feasible solution thus
far
- Returns:
- iteration or
-1
if no feasible solution was found
@Deprecated public int getBestFeasibleReplicationsNumber()
Deprecated.
call
if it returns
otherwise there is no best feasible solution
isBestSolutionFeasible()
and check its result:if it returns
true
, use getBestReplicationsNumber()
;otherwise there is no best feasible solution
Returns the number of replications evaluated for the best feasible solution
Ensure replications are used (
Ensure replications are used (
isUseReplications()
) before calling
this method- Returns:
- number of replications or
-1
if no feasible solution was found
@Deprecated public double getBestFeasibleObjectiveValue()
Deprecated.
call
if it returns
otherwise there is no best feasible solution
isBestSolutionFeasible()
and check its result:if it returns
true
, use getBestObjectiveValue()
;otherwise there is no best feasible solution
Returns the value of the objective function for the best feasible
solution found thus far
May return
May return
Double.NaN
if no feasible solution was found- Returns:
- the value of the objective function for the best feasible solution found thus far
- See Also:
getBestFeasibleParamValue(COptQuestVariable)
@Deprecated public double getBestFeasibleParamValue(com.opttek.optquest.COptQuestVariable optimizationParameterVariable)
Deprecated.
call
if it returns
otherwise there is no best feasible solution
isBestSolutionFeasible()
and check its result:if it returns
true
, use getBestParamValue(COptQuestVariable)
;otherwise there is no best feasible solution
Returns the value of the given optimization parameter variable for the
best feasible solution found thus far
May return
May return
Double.NaN
if no feasible solution was found- Returns:
- the value of the given optimization parameter variable for the best feasible solution found thus far
public void selectNthBestSolution(int bestSolutionIndex)
Called by the user to identify the Nth best soluiton.
Subsequent calles to
Subsequent calles to
getSelectedNthBestObjectiveValue()
and
getSelectedNthBestParamValue(COptQuestVariable)
methods use this
setting to identify the solution. This method locates the Nth best
solution and sets up data for subsequent calls that retrieve specific
pieces of information- Parameters:
bestSolutionIndex
-1
for the best solution,2
for the second best etc.- See Also:
getSelectedNthBestObjectiveValue()
,getSelectedNthBestParamValue(COptQuestVariable)
public int getSelectedNthBestIteration()
Returns the iteration number for the Nth best solution, where the Nth
best solution is identified by the method
selectNthBestSolution(int)
- Returns:
- the iteration of the Nth best solution
- See Also:
selectNthBestSolution(int)
public int getSelectedNthBestReplicationsNumber()
Returns the number of replications for the Nth best solution, where the
Nth best solution is identified by the method
Ensure replications are used (
selectNthBestSolution(int)
Ensure replications are used (
isUseReplications()
) before calling
this method- Returns:
- the number of replications in the nth best solution
- See Also:
selectNthBestSolution(int)
public double getSelectedNthBestObjectiveValue()
Returns the objective value for the Nth best solution, identified by the
method
selectNthBestSolution(int)
- Returns:
- the objective value of the Nth best solution. Returns 0 if the solution doesn't exist
- See Also:
selectNthBestSolution(int)
public double getSelectedNthBestParamValue(com.opttek.optquest.COptQuestVariable optimizationParameterVariable)
Used to retrieve the value of the variable for the solution that produced
the Nth best objective value
The Nth best solution is identified by calling
The Nth best solution is identified by calling
selectNthBestSolution(int)
- Parameters:
optimizationParameterVariable
-- Returns:
- the variable's value for the Nth best solution
- See Also:
selectNthBestSolution(int)
public boolean isSelectedNthBestSolutionFeasible()
Returns
true
if nth best solution satisfies all
constraints and requirements- Returns:
true
if nth best solution satisfies all constraints and requirements,false
otherwise- See Also:
selectNthBestSolution(int)
public com.opttek.optquest.COptQuestOptimization getOptimization()
Returns the optimization engine. The returned instance is recreated fresh
each time the experiment is started.
- Returns:
- the optimization engine instance
- Since:
- 8.5
public void setObjectiveMinimize()
Sets the goal of the optimization to minimize the objective value
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
public void setObjectiveMaximize()
Sets the goal of the optimization to maximize the objective value
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
public void setParameterVariableName(com.opttek.optquest.COptQuestVariable variable, java.lang.String name)
Assigns a name to the variable
Names must be alphanumeric and cannot be a function name
This is optimization setup method, user should not call it
Names must be alphanumeric and cannot be a function name
This is optimization setup method, user should not call it
- Parameters:
variable
-name
-
public void setParameterVariableLowerBound(com.opttek.optquest.COptQuestVariable variable, double value)
Sets lower bound size for optimization parameter variable
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
- Parameters:
variable
-value
-
public void setParameterVariableUpperBound(com.opttek.optquest.COptQuestVariable variable, double value)
Sets upper bound size for optimization parameter variable
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
- Parameters:
variable
-value
-
public void setParameterVariableSuggestedValue(com.opttek.optquest.COptQuestVariable variable, double value)
Allows the user to suggest a solution by setting a suggested value for
each variable
This is optimization setup method, user should not call it
addSuggestedSolution()
indicates the suggested solution is
complete and should be added to the set of solutions to be evaluated.This is optimization setup method, user should not call it
- Parameters:
variable
-value
-
public void setParameterVariableStepSize(com.opttek.optquest.COptQuestDiscreteVariable variable, double value)
Sets step size for optimization parameter variable
Used for discrete variables
This is optimization setup method, user should not call it
Used for discrete variables
This is optimization setup method, user should not call it
- Parameters:
variable
-value
-
public void addParameterVariable(com.opttek.optquest.COptQuestVariable variable)
Adds the variable defined by the input parameter to the optimization
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
- Parameters:
variable
-
public void addSuggestedSolution()
This method signals the completion of a suggested solution definition.
This method signals a value has been set for each variable.
The solution is added to the set of suggested solution and will be one of the first solutions evaluated if the optimization has not started.
If the optimization is running, the suggested solution will be one of the next solutions to be evaluated
This is optimization setup method, user should not call it
setParameterVariableSuggestedValue(COptQuestVariable, double)
is used to set a
value for each variable.This method signals a value has been set for each variable.
The solution is added to the set of suggested solution and will be one of the first solutions evaluated if the optimization has not started.
If the optimization is running, the suggested solution will be one of the next solutions to be evaluated
This is optimization setup method, user should not call it
public void setLinearConstraintRHS(com.opttek.optquest.COptQuestConstraint constraint, double value)
Sets the right hand side value of a linear constraint
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
- Parameters:
constraint
-value
-
public void addLinearConstraintVariable(com.opttek.optquest.COptQuestConstraint constraint, com.opttek.optquest.COptQuestVariable variable, double coefficient)
Adds a variable and its coefficient to the linear expression
This method is called for each variable that is used in the left hand side expression
For example, the constraint
This is optimization setup method, user should not call it
This method is called for each variable that is used in the left hand side expression
For example, the constraint
2*Var1 + 3*Var2 + 1.5*Var3 <= 100
would call
addLinearConstraintVariable(Var1,2), addLinearConstraintVariable(Var2, 3)
and addLinearConstraintVariable(Var3,1.5)This is optimization setup method, user should not call it
- Parameters:
constraint
-variable
-coefficient
-
public void addConstraint(com.opttek.optquest.COptQuestConstraint constraint)
Adds the constraint defined by the input parameter to the optimization
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
- Parameters:
constraint
-
public void setConstraintEquation(com.opttek.optquest.COptQuestStringConstraint constraint, java.lang.String equation)
Sets the mathematical expression that defines the constraint
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
- Parameters:
constraint
-equation
-
public void addConstraint(com.opttek.optquest.COptQuestStringConstraint constraint)
Adds the string constraint defined by the input parameter to the
optimization
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
- Parameters:
constraint
-
public void setRequirementLowerBound(com.opttek.optquest.COptQuestRequirement requirement, double value)
Sets the lower bound of requirement to the input value
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
- Parameters:
requirement
-value
-
public void setRequirementUpperBound(com.opttek.optquest.COptQuestRequirement requirement, double value)
Sets the upper bound of requirement to the input value
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
- Parameters:
requirement
-value
-
public void addRequirement(com.opttek.optquest.COptQuestRequirement requirement)
Adds the requirement defined by the input parameter to the optimization
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
- Parameters:
requirement
-
public void setCurrentObjectiveValue(double value)
Used to set the value of the objective for the current solution. This
method should be called from the
This is optimization setup method, user should not call it
Experiment.onEngineFinished()
method when the user
is calculating the objective valueThis is optimization setup method, user should not call it
- Parameters:
value
-
public void setCurrentRequirementValue_xjal(com.opttek.optquest.COptQuestRequirement requirement, double value)
Used to set the value of the requirement for the current solution. This
method should be called from the
This is optimization setup method, user should not call it
Experiment.onEngineFinished()
method when the user
is calculating the requirement valueThis is optimization setup method, user should not call it
- Parameters:
value
-
public void stopOptimization()
Stops the currently running optimization
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
public void setRejectNonLinear(boolean reject)
Directs the OptQuest Engine to reject solutions that violate non-linear
constraints without performing simulation.
Non-linear constraints can be checked for feasibility before the simulation. If the solution violates any non-linear constraints, the simulation is not needed.
The default value is
This is optimization setup method, user should not call it
Non-linear constraints can be checked for feasibility before the simulation. If the solution violates any non-linear constraints, the simulation is not needed.
The default value is
false
This is optimization setup method, user should not call it
- Parameters:
reject
-true
if infeasible solutions should be rejected.
false
if they should be evaluated
public void setUseReplications(boolean useReplications)
Sets optimization to use replications
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
- Specified by:
setUseReplications
in classExperimentMultipleRuns<ROOT extends Agent>
- Parameters:
useReplications
-- See Also:
setFixedReplicationsNumber(int)
,setVariableReplicationsNumber(int, int, com.anylogic.engine.ExperimentMultipleRuns.ConfidenceLevel, double)
public final boolean isUseReplications()
Returns
true
if optimization uses replications- Specified by:
isUseReplications
in classExperimentMultipleRuns<ROOT extends Agent>
- Returns:
true
if optimization uses replications,false
otherwise
public void setFixedReplicationsNumber(int replicationsNumber)
Description copied from class:
ExperimentMultipleRuns
Sets experiment to use a fixed number of replications.
No confidence testing is to be used
For confidence testing use
This is setup method, user should not call it
No confidence testing is to be used
For confidence testing use
ExperimentMultipleRuns.setVariableReplicationsNumber(int, int, ConfidenceLevel, double)
This is setup method, user should not call it
- Specified by:
setFixedReplicationsNumber
in classExperimentMultipleRuns<ROOT extends Agent>
- Parameters:
replicationsNumber
- the number of replications to be run- See Also:
ExperimentMultipleRuns.setUseReplications(boolean)
public void setVariableReplicationsNumber(int minimumReplications, int maximumReplications, ExperimentMultipleRuns.ConfidenceLevel confidenceLevel, double errorPercent)
Description copied from class:
ExperimentMultipleRuns
Sets experiment to stop replications after the minimum replications when
This is optimization setup method, user should not call it
- the confidence level is reached (i.e. mean confidence is within the given
percentage
errorPercent
of the value obtained at the last replication) - maximum replications number is reached
ExperimentMultipleRuns.setFixedReplicationsNumber(int)
This is optimization setup method, user should not call it
- Specified by:
setVariableReplicationsNumber
in classExperimentMultipleRuns<ROOT extends Agent>
- Parameters:
minimumReplications
- minimum number of replicationsmaximumReplications
- minimum number of replicationsconfidenceLevel
- one oferrorPercent
- the error percentage as a value > 0 and < 1.- See Also:
ExperimentMultipleRuns.setUseReplications(boolean)
public void setMaximumIterations(int numberOfIterations)
Sets the number of iterations the optimization should perform before
stopping. If multiple stop options are set, the optimization will stop at
the first option that is satisfied
This is optimization setup method, user should not call it
This is optimization setup method, user should not call it
- Parameters:
numberOfIterations
- number of optimization iterations to be performed
public void setAutoStop(boolean stop)
Sets the auto stop option.
If the input parameter is
OptQuest uses different techniques to search for a better solution and cycles through them when determines that the current technique stops helping to improve the solution. When automatic stop is set, the optimization stops when OptQuest has already cycled through all of its techniques for two (default) times. This method is an equivalent of
This is optimization setup method, user should not call it
If the input parameter is
true
, auto stop is turned on.
The default is auto stop is turned off.OptQuest uses different techniques to search for a better solution and cycles through them when determines that the current technique stops helping to improve the solution. When automatic stop is set, the optimization stops when OptQuest has already cycled through all of its techniques for two (default) times. This method is an equivalent of
getOptimization().SetAutoStopByCycles(stop);
This is optimization setup method, user should not call it
- Parameters:
stop
-true
if auto stop is to be used,false
if it is not used
public void setUserControlledStop(boolean stop)
Indicates the user will stop the optimization by calling the
This is optimization setup method, user should not call it
stopOptimization()
methodThis is optimization setup method, user should not call it
- Parameters:
stop
-true
if the user will stop the optimization
false
if the optimization will be stopped by setting the number of iterations or the maximum time
public boolean isLastReplication()
Return
This is optimization setup method, user should not call it
true
if we have run the last replication for the current solutionThis is optimization setup method, user should not call it
- Specified by:
isLastReplication
in classExperimentMultipleRuns<ROOT extends Agent>
- Returns:
true
if this is the last replication of the iteration
@AnyLogicInternalCodegenAPI public abstract void setupRootParameters(ROOT root, boolean callOnChangeActions)
Is called to setup parameters of top-level agent.
This method must be defined in a subclass.
- Parameters:
root
- the top-level agent instancecallOnChangeActions
- iftrue
this method should useset_*
methods ofroot
to setup parameters, otherwise parameter values should be simply assigned to the fields ofroot
public void setLogBufferLength(int length)
public static com.opttek.optquest.COptQuestOptimization createOptimization(Engine engine)
Creates and returns new OptQuest optimization instance for Custom Experiment
This method should only be used in custom experiment code
This method is designed for use in the AnyLogic Professional only
This method should only be used in custom experiment code
This method is designed for use in the AnyLogic Professional only
- Parameters:
engine
- the engine instance- Returns:
- new OptQuest optimization instance
See OptQuest API documentation for further usage information - See Also:
createOptimization(Engine, OptimizationCallback)
public static com.opttek.optquest.COptQuestOptimization createOptimization(Engine engine, OptimizationCallback callback)
Creates and returns new OptQuest optimization instance for Custom
Experiment with objective function defined in a free form using
evaluate
method of a special callback. For more information see the
example of such optimization.
This method should only be used in custom experiment code
This method is designed for use in the AnyLogic Professional only
This method should only be used in custom experiment code
This method is designed for use in the AnyLogic Professional only
- Parameters:
engine
- the engine instancecallback
- the callback for evaluate (and monitorStatus) methods- Returns:
- new OptQuest optimization instance
See OptQuest API documentation for further usage information
-
How can we improve this article?
-