InputDefinition

class InputDefinition(val name: String, val lowerBound: Double, val upperBound: Double, granularity: Double = 0.0)

Represents the definition of an input variable for a ProblemDefinition. Input variables are the variables used in the problem to model the decision parameter of the simulation model. The input variable name should correspond to some named parameter (e.g. control) in the model.

The specified granularity indicates the acceptable precision for the variable's value with respect to decision-making. If the granularity is 0 then no rounding will be applied when evaluating the variable. Granularity defines the level of precision for an input variable to which the problem will be solved. Setting granularity to 0, the default, means that the solver will attempt to find a solution to the level of machine precision. For any positive granularity value, the solution will be found to some multiple of that granularity. As a special case, setting granularity to 1 implies an integer-ordered input variable. The specification of granularity reflects a reality for the decision maker that there is a level of precision beyond which it is not practical to implement a solution.

Parameters

name

the name of the input variable

lowerBound

the lower bound on the range of possible values

upperBound

the upper bound on the range of possible values

granularity

the acceptable precision for decision-making

Constructors

Link copied to clipboard
constructor(name: String, interval: Interval, granularity: Double)

Represents the definition of an input variable for a ProblemDefinition. Input variables are the variables used in the problem to model the decision parameter of the simulation model. The input variable name should correspond to some named parameter (e.g. control) in the model.

constructor(name: String, lowerBound: Double, upperBound: Double, granularity: Double = 0.0)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
operator fun contains(x: Double): Boolean
Link copied to clipboard

Requires granularity to be greater than 0.0 or an IllegalArgumentException will be thrown. If granularity is 0.0, then the set of points is infinite.

Link copied to clipboard
fun randomValue(rnStream: RNStreamIfc = KSLRandom.defaultRNStream()): Double

Randomly generates a value within the input variable's range with the appropriate granularity

Link copied to clipboard

This function does not check if the supplied value is within the specified bounds. Thus, the returned value may be infeasible with respect to bounds.

Link copied to clipboard
open override fun toString(): String