The Constraint Vector Collection
The ConstraintVector object is an element of the ConstraintVectors collection and contains all the information stored about each constraint vector in the model.
Collections contained by the ConstraintVector Object
Subscripts
Returns the Subscripts collection for the constraint vector. (Object Property)
Constraint
Returns the Constraint object for the constraint specified by the Position property. (Object Property)
Properties for the ConstraintVector Object
Count
The number of elements in the constraint vector. (Integer Property - Read Only)
Declaration
The declaration of the constraint vector. (String Property - Read Only)
Name
The name of the constraint vector. (String Property - Read Only)
Position
The current position within the vector. (Integer Property - Read/Write)
PosValid
True if the current position is valid. (Boolean Property - Read only)
Methods for the ConstraintVector Object
MoveFirstPos
Moves the Position property to the first element of the constraint vector. (Method)
MoveNextPos
Moves the Position property to the next valid element of the constraint vector. (Method)
MoveSubscrPos (Subscr1, Subscr2, Subscr3)
Moves the Position property to the vector element specified by the subscripts. (Method)
Visual Basic Example:
Dim MPL As OptiMax Dim planModel As Model Dim conVect As ConstraintVector Dim con As Constraint Dim result As Integer Set MPL = New OptiMax MPL.Solvers.Add "CPLEX" MPL.WorkingDirectory = "c:\mplwin4x" Set planModel = MPL.Models.Add("c:\mplwin4\planning") result = planModel.ReadModel("c:\mplwin4\planning.mpl") If (result > 0) Then MsgBox planModel.ErrorMessage End If planModel.Solve MsgBox planModel.ConstraintVectors.Count Set conVect = planModel.ConstraintVectors("InvtBal") Set con = conVect.MoveFirstPos Do While conVect.PosValid Debug.Print "InvtBal[" & conVect.Subscripts(1).IndexName & _ ", " & conVect.Subscripts(2).IndexName & "] " & _ " = " & conVect.Constraint.ShadowPrice conVect.MoveNextPos Loop