com.opttek.optquest
Class COptQuestSolutionSet

java.lang.Object
  extended by com.opttek.optquest.COptQuestSolutionSet

public class COptQuestSolutionSet
extends java.lang.Object

The COptQuestSolutionSet class allows you to select a set of solutions and perform statistical analysis or sensitivity analysis on the set. Solutions are selected using a filter that you implement via the ISolutionFilter interface. A COptQuestSolutionSet object is created by calling COptQuestOptimization.CreateSolutionSet(). A filter is added by the COptQuestSolutionSet.SetSolutionFilter() method. The solution set is loaded by the COptQuestSolutionSet.LoadSolutionSet() method where you specify the number of solutions you want in the set and how you want the solutions to be ordered. If not ISolutionFilter is defined, solutions are included in the set until the count requested is satisfied.


Field Summary
static int ORDER_DONTCARE
           
static int ORDER_ITERATION
           
static int ORDER_NTHBEST
          Identifies how the solutions should be ordered in the set.
 
Method Summary
 double CalculateSensitivity(COptQuestObjective obj)
          Returns the sensitivity score for the objective.
 double CalculateSensitivity(COptQuestVariable var)
          Calculate a sensitivity score for the input variable.
 double CalculateStatistic(COptQuestObjective obj, int statistic, double statisticValue)
          Using the solution set values for the objective, calculate the specified statistic
 double CalculateStatistic(COptQuestVariable var, int statistic, double statisticValue)
          Using the solution set values of the specified variable, calculate the specified statistic.
 int GetNumberOfSolutions()
          Returns the actual number of solutions in the solution set.
 java.util.ArrayList<COptQuestSolution> GetSolutionsInSet()
          Returns the list of COptQuestSolution objects that satisfied the filter.
 void LoadSolutionSet(int numSolutions, int orderBy)
          Loads the solution set with the specified number of solutions, ordered by the orderBy parameter.
 void SetSolutionFilter(ISolutionFilter userFilter)
          Defines a ISoluitonFilter interface that will be used to select solutions.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ORDER_NTHBEST

public static final int ORDER_NTHBEST
Identifies how the solutions should be ordered in the set. ORDER_NTHEBEST - solutions will be ordered using the objective value starting with the solution that had the best objective value. ORDER_ITERATION - solutions are ordered based on the iteration counter. ORDER_DONTCARE - no guarnteed order.

See Also:
Constant Field Values

ORDER_ITERATION

public static final int ORDER_ITERATION
See Also:
Constant Field Values

ORDER_DONTCARE

public static final int ORDER_DONTCARE
See Also:
Constant Field Values
Method Detail

SetSolutionFilter

public void SetSolutionFilter(ISolutionFilter userFilter)
Defines a ISoluitonFilter interface that will be used to select solutions. If no filter is specified, solutions are added to the set based on the number requested and the orderBy paramater of the LoadSolutionSet() method.

Parameters:
userFilter -

GetNumberOfSolutions

public int GetNumberOfSolutions()
Returns the actual number of solutions in the solution set.

Returns:
The number of solutions in the solution set

LoadSolutionSet

public void LoadSolutionSet(int numSolutions,
                            int orderBy)
                     throws COptQuestException
Loads the solution set with the specified number of solutions, ordered by the orderBy parameter. You determine what solutions are included in the set by implementing the IncludeInSet() method of the ISolutionFilter interface. If no filter is specified, solutions are added to the set based on the numSolutions parameter and the orderBy parameter.

Parameters:
numSolutions - - if -1, all solutions are examined. Otherwise the number of solutions you want in the set.
orderBy - specifies how the solutions should be sorted. COptQuestSolutionSet.ORDER_NTHBEST - solutions are sorted by their objective value. COptQuestSolutionSet.ORDER_ITERATION - solutions are sorted by their iteration COptQuestSolutionSet.ORDER_DONTCARE - user doesn't care about ordering solutions
Throws:
COptQuestException

GetSolutionsInSet

public java.util.ArrayList<COptQuestSolution> GetSolutionsInSet()
Returns the list of COptQuestSolution objects that satisfied the filter. The list is ordered based on the orderBy parameter specified in the LoadSolutionSet() method.

Returns:
array of solutions in the set

CalculateStatistic

public double CalculateStatistic(COptQuestVariable var,
                                 int statistic,
                                 double statisticValue)
                          throws COptQuestException
Using the solution set values of the specified variable, calculate the specified statistic.

Parameters:
var - COptQuestVariable to be evaluated.
statistic -
  • OCLP_MEAN = 1
  • OCLP_MEDIAN = 2
  • OCLP_PERCENTILE = 3
  • OCLP_STDDEV = 4
  • OCLP_SEMI1STDDEV = 5
  • OCLP_VARIANCE = 6
  • OCLP_SEMI1VARIANCE = 7
  • OCLP_COEFFOFVAR = 8
  • OCLP_COEFFOFSEMI1VAR = 9
  • OCLP_PROBABILITY = 10
  • OCLP_SEMI2STDDEV = 11
  • OCLP_SEMI2VARIANCE = 12
  • OCLP_COEFFOFSEMI2VAR = 13
  • OCLP_MIN = 14
  • OCLP_MAX = 15
statisticValue - target values for OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV, OCLP_PROBABILITY
Returns:
the result of the calculation
Throws:
COptQuestException

CalculateStatistic

public double CalculateStatistic(COptQuestObjective obj,
                                 int statistic,
                                 double statisticValue)
                          throws COptQuestException
Using the solution set values for the objective, calculate the specified statistic

Parameters:
obj - COptQuestObjective to be evaluated.
statistic -
  • OCLP_MEAN = 1
  • OCLP_MEDIAN = 2
  • OCLP_PERCENTILE = 3
  • OCLP_STDDEV = 4
  • OCLP_SEMI1STDDEV = 5
  • OCLP_VARIANCE = 6
  • OCLP_SEMI1VARIANCE = 7
  • OCLP_COEFFOFVAR = 8
  • OCLP_COEFFOFSEMI1VAR = 9
  • OCLP_PROBABILITY = 10
  • OCLP_SEMI2STDDEV = 11
  • OCLP_SEMI2VARIANCE = 12
  • OCLP_COEFFOFSEMI2VAR = 13
  • OCLP_MIN = 14
  • OCLP_MAX = 15
statisticValue - target values for OCLP_PERCENTILE, OCLP_SEMI1STDDEV, OCLP_SEMI2STDDEV, OCLP_PROBABILITY
Returns:
the result of the calculation
Throws:
COptQuestException

CalculateSensitivity

public double CalculateSensitivity(COptQuestVariable var)
                            throws COptQuestException
Calculate a sensitivity score for the input variable. Score is calculated as (the range of values in the solution set)/(var upper bound - var lower bound) If a variable's sensitivity score is -1, the variables value is fixed. (low bound = high bound) If a variable's sensitivity score is close to 1, the variable is considered very sensitive. If a variable's sensitivity score is close to 0, it is considered insensitive.

Parameters:
var -
Returns:
-1 or a value between 0 and 1
Throws:
COptQuestException

CalculateSensitivity

public double CalculateSensitivity(COptQuestObjective obj)
                            throws COptQuestException
Returns the sensitivity score for the objective. Score is calculated as (the range of values in the solution set)/best objective - worst objective in all solutions. If the solution set includes infeasible solutions, the denominator calculation will include infeasible solution. If the solution set contains only feasible solutions, the denominator calculation will only include feasible solutions. If the objective's sensitivity score is -1, than the solutions for this problem all had the same objective value. If the objective's sensitivity score is close to 1, the objective is considered very sensitive. If the objective's sensitivity score is close to 0, it is considered insensitive.

Parameters:
obj -
Returns:
objective's sensitivity score
Throws:
COptQuestException