Class COptQuestExchangeableGroup

java.lang.Object
com.opttek.optquest.COptQuestExchangeableGroup

public class COptQuestExchangeableGroup extends Object
COptQuestExchangeableGroup is a set of identical items whose values you can exchange without a change to the result. Each item is one variable, or one sub-group of variables that together describe the item. An example is three identical machines in a factory, each with an x and a y position: a layout and the same layout with two machines exchanged have the same result.

In each trial solution that the optimizer generates, it puts the items in ascending order of their values, in the order that you added the items. For single variables, the first item has the smallest value. For sub-groups, the order is by the first variable of each sub-group, then by the second variable when the first values are equal, and so on. Thus the optimizer does not evaluate two solutions that differ only by an exchange of items. The optimizer evaluates a solution that you suggest with the values that you give, in any order.

Use an exchangeable group only for items that have the same type, the same bounds and the same role in your evaluation. If the items differ, a solution and the same solution with two items exchanged are different solutions, and the optimizer evaluates only one of them. If the bounds differ, the optimizer searches only values that fit the bounds of the members in ascending order. Put a variable in no more than one exchangeable group. If a variable is in two groups, the order of the second group can break the order of the first group.

  • Constructor Details

    • COptQuestExchangeableGroup

      public COptQuestExchangeableGroup()
  • Method Details

    • AddVariable

      public void AddVariable(COptQuestVariable variable) throws COptQuestException
      Adds one variable to the group as one item. This is the same as a call to AddVariableGroup(COptQuestVariable[]) with an array of one variable. All the items of a group must have the same number of variables.
      Parameters:
      variable - - the variable to add as one item.
      Throws:
      COptQuestException - - EXCEPT_BADVARIABLEDIMENSIONS, "Variable definitions are of unequal length.", if the group already holds items of more than one variable.
    • AddVariableGroup

      public void AddVariableGroup(COptQuestVariable[] variableGroup) throws COptQuestException
      Adds one item that several variables describe together, for example the x and the y position of one machine. All the items of a group must have the same number of variables, and the variables must be in the same order in each item.
      Parameters:
      variableGroup - - the variables of one item.
      Throws:
      COptQuestException - - EXCEPT_BADVARIABLEDIMENSIONS, "Variable definitions are of unequal length.", if the number of variables is not the same as in the items that the group already holds.