Class COptQuestExchangeableGroup
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAddVariable(COptQuestVariable variable) Adds one variable to the group as one item.voidAddVariableGroup(COptQuestVariable[] variableGroup) Adds one item that several variables describe together, for example the x and the y position of one machine.
-
Constructor Details
-
COptQuestExchangeableGroup
public COptQuestExchangeableGroup()
-
-
Method Details
-
AddVariable
Adds one variable to the group as one item. This is the same as a call toAddVariableGroup(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
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.
-