ProblemDefinition

class ProblemDefinition(problemName: String? = null, val modelIdentifier: String, val objFnResponseName: String, inputNames: List<String>, responseNames: List<String> = emptyList(), indifferenceZoneParameter: Double = 0.0) : IdentityIfc

This class describes an optimization problem for use within simulation optimization algorithms. The general optimization problem is presented as minimizing the expected value of some function H(x), where x is some input parameters to the simulation and H(.) is the simulation model response for the objective function. The input parameters are assumed to be real-valued specified by a name between a lower and upper bound and a granularity. The granularity specifies the acceptable precision of the input. The problem can have a set of linear constraints. The linear constraints are a deterministic function of the inputs. The problem can also have a set of functional constraints. A functional constraint is a deterministic function of the inputs that is bounded by constraints. This permits non-linear deterministic functional forms for the problem. In addition, a set of probabilistic constraints of the form EG(x)< c can be specified, where G(x) is some response from the simulation.

To use this class, the user first defines the objective function response name, the names of the input variables, and the names of the responses to appear in the problem. Then the reference to the class can be used to specify inputs and constraints.

Parameters

problemName

the name of the problem for labeling and identification purposes. If no name is supplied, then a unique name is constructed.

modelIdentifier

the identifier of the model that this problem definition is associated with. The identifier should correspond to an actual model name registered with a simulation provider. The input names and response names should be valid for the identified model.

objFnResponseName

the name of the response within the simulation model. This name is used to extract the observed simulation values from the simulation

inputNames

the names of the inputs for the simulation model. These names are used to set values for the simulation when executing experiments. Any constraints specified on the input variables must use these names.

responseNames

the names of any responses that will appear in response constraints. The default is empty.

indifferenceZoneParameter

a parameter that represents the smallest actual difference that is important to detect for the objective function response. This parameter can be used by solvers to determine if differences between solutions are considered practically insignificant. The default is zero.

Constructors

Link copied to clipboard
constructor(problemName: String? = null, modelIdentifier: String, objFnResponseName: String, inputNames: List<String>, responseNames: List<String> = emptyList(), indifferenceZoneParameter: Double = 0.0)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Returns a list of the names for all the responses referenced in the problem in the order in which they are specified in the problem creation. The first name will be the name of the response associated with the objective function, then each response name from the provided set of response names.

Link copied to clipboard

The functional constraints for the problem as a list

Link copied to clipboard
open override val id: Int
Link copied to clipboard

A parameter that represents the smallest actual difference that is important to detect for the objective function response. This parameter can be used by solvers to determine if differences between solutions are considered practically insignificant. The default is zero. Must be greater than or equal to zero.

Link copied to clipboard

The input definitions for the problem as a list

Link copied to clipboard

The input definitions as a list. The key is the name of the input parameter, and the value is the input definition.

Link copied to clipboard

The granularity associated with each input variable as an array

Link copied to clipboard

The intervals for each input variable

Link copied to clipboard

The lower bounds for each input variable

Link copied to clipboard

The mid-point of each input variable's range

Link copied to clipboard

The names of the input parameters over which the problem is being optimized, i.e., the decision variable names. These need to correspond to simulation model inputs. This list cannot be empty.

Link copied to clipboard

The range (width) of each input variable's interval

Link copied to clipboard

The number of input variables

Link copied to clipboard

The upper bounds for each input variable

Link copied to clipboard
open override var label: String?
Link copied to clipboard

The linear constraints for the problem as a list

Link copied to clipboard

The maximum number of iterations when sampling for an input feasible point

Link copied to clipboard

The mid-point of each input variable's range as an input map

Link copied to clipboard
Link copied to clipboard
open override val name: String
Link copied to clipboard
Link copied to clipboard

The response constraints as a list

Link copied to clipboard

The names of the responses over which the problem is being optimized. These are the simulation response names. This list may be empty.

Link copied to clipboard

Can be supplied to provide a method for specifying a feasible starting point. The default is to randomly generate a starting point

Functions

Link copied to clipboard

Creates an infeasible and bad solution. This is useful when initializing solvers or when rejecting requests.

Link copied to clipboard

Returns a new empty response map to hold the responses associated with the problem

Link copied to clipboard
fun functionalConstraint(lhsFunc: ConstraintFunctionIfc, rhsValue: Double = 0.0, inequalityType: InequalityType = InequalityType.LESS_THAN): FunctionalConstraint

Creates an FunctionalConstraint based on the supplied function.

Link copied to clipboard
fun generateInputFeasibleValues(rnStream: RNStreamIfc = KSLRandom.defaultRNStream()): InputMap

Generates a random point that is feasible with respect to the input ranges, the linear constraints, and the functional constraints. If the number of sampling iterations needed to get a feasible point exceeds maxFeasibleSamplingIterations then an IllegalStateException will occur.

Link copied to clipboard
fun generateRandomInputValues(rnStream: RNStreamIfc = KSLRandom.defaultRNStream()): InputMap

Generates a random point within the ranges defined by the inputs. The point will have the appropriate granularity based on the definitions of the inputs.

Link copied to clipboard
fun inputVariable(name: String, interval: Interval, granularity: Double = 0.0): InputDefinition
fun inputVariable(name: String, lowerBound: Double, upperBound: Double, granularity: Double = 0.0): InputDefinition

Defines an input variable for the problem. The order of specification for the input variables defines the order when interpreting an array of inputs.

Link copied to clipboard

Interprets the supplied map as inputs for the problem definition and returns true if the values are within functional constraints. False will be returned if at least one functional constraint is infeasible.

Link copied to clipboard

The supplied input is considered input-feasible if it is feasible with respect to the defined input parameter ranges, the linear constraints, and the functional constraints.

Link copied to clipboard

Interprets the supplied map as inputs for the problem definition and returns true if the values are within the ranges defined for the variables. False will be returned if at least one input variable is not within its defined range.

Link copied to clipboard

Interprets the supplied map as inputs for the problem definition and returns true if the values are within linear constraints. False will be returned if at least one linear constraint is infeasible.

Link copied to clipboard

Returns true if the name is a valid response name or the name associated with the objective function.

Link copied to clipboard
fun linearConstraint(equation: Map<String, Double>, rhsValue: Double = 0.0, inequalityType: InequalityType = InequalityType.LESS_THAN): LinearConstraint

Creates an LinearConstraint based on the supplied linear equation as specified by the map. The names in the map must be valid input names. If an input name does not exist in the map, then the coefficient for that variable is assumed to be 0.0.

Link copied to clipboard

Returns the coefficients of the constraints as a matrix. Assume we have the constraint A*x < b, then this function returns the A matrix. The coefficients have been adjusted to ensure a less-than orientation for the constraints.

Link copied to clipboard

Returns the coefficients of the constraints as a matrix. Assume we have the constraint Ax < b or Ax b, then this function returns the A matrix. The coefficients have not been adjusted for the direction of the constraints.

Link copied to clipboard

Returns the coefficients of the constraints as a matrix. Assume we have the constraint Ax < b or Ax b, then this function returns the b vector. The values have been adjusted for the direction of the constraint.

Link copied to clipboard

Returns the adjusted left-hand side values for each constraint. Make the adjustment such that the constraint is considered less-than orientation.

Link copied to clipboard

Assume we have the constraint, Ax < b or Ax b, then this function returns the b vector. The values have not been adjusted for the direction of the constraint.

Link copied to clipboard

Creates an input map centered at the mid-points of all the input variables

Link copied to clipboard
fun randomInputName(rnStream: RNStreamIfc = KSLRandom.defaultRNStream()): String

Randomly selects from the list of valid input names with an equal likelihood.

Link copied to clipboard
fun randomizeInputFeasibleValue(map: MutableMap<String, Double>, rnStream: RNStreamIfc = KSLRandom.defaultRNStream(), name: String = randomInputName(rnStream)): InputMap

Randomly generates a new value for the named input variable and a new input map. The input should be feasible with respect to linear or functional constraints. If the number of sampling iterations needed to get a feasible point exceeds maxFeasibleSamplingIterations then an IllegalStateException will occur.

Link copied to clipboard
fun randomizeInputValue(map: MutableMap<String, Double>, rnStream: RNStreamIfc = KSLRandom.defaultRNStream(), name: String = randomInputName(rnStream)): InputMap

Randomly generates a new value for the named input variable and returns a new input map. The input map may not be feasible with respect to linear or functional constraints.

Link copied to clipboard
fun responseConstraint(name: String, rhsValue: Double, inequalityType: InequalityType = InequalityType.LESS_THAN, target: Double = 0.0, tolerance: Double = 0.0): ResponseConstraint

Creates an ResponseConstraint based on the supplied response name and right-hand side value.

Link copied to clipboard

Returns the adjusted right-hand side values for the response constraints.

Link copied to clipboard

Returns the unadjusted right-hand side values for the response constraints.

Link copied to clipboard

The violations associated with the response constraints for the provided values within the response map.

Link copied to clipboard

The array x is mutated to hold values that have appropriate granularity based on the input definitions.

The map values are mutated to hold values that have appropriate granularity and range based on the input definitions.

Link copied to clipboard
fun startingPoint(rnStream: RNStreamIfc = KSLRandom.defaultRNStream()): InputMap

Returns a starting point for the problem. If the user specified an instance of the StartingPointIfc via the ProblemDefinition.startingPointGenerator property then the supplied generator is used; otherwise, the problem definition attempts to randomly generate an input feasible starting point via the ProblemDefinition.generateInputFeasibleValues function.

Link copied to clipboard

Translates the supplied array to named input pairs (name, value). Assumes that the order of the array is the same as the order of the defined names for the problem. If the supplied value is outside the range of the name variable, it is adjusted to the closest boundary. In addition, the granularity of the input variable is applied.

Ensures that the supplied map is translated to an appropriate map containing name, value pairs for this problem. The resulting InputMap will have valid names and values that are input-range-feasible. The values will be rounded to the appropriate granularity for the named input variable.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun validate(inputs: Map<String, Double>): Boolean

Checks if the supplied map has valid names and valid values (input range feasible)

Link copied to clipboard
fun validateInputVariable(inputName: String, value: Double): Boolean

Checks if the supplied value is a valid input value for the supplied input name.

Link copied to clipboard

Checks if the names in the map are valid for the problem definition

Link copied to clipboard

Validates whether the provided model has the input and response names required by the problem.