The Models collection is used to store a list of a Model objects. The parent OptiMax object uses the Models collection to store a list of all the models that are currently defined.
The number of Model objects in the collection. (Integer Property - Read Only)
Returns the selected Model object. (Object Property)
Adds a new Model object to the collection. (Method)
Copies the selected Model object and adds it to the collection. (Method)
Deletes all Model objects from the collection. (Method)
Visual Basic Example:
Dim MPL As OptiMax Dim mplModel As Model Dim planModel As Model Dim dietModel As Model Dim Result As Integer Dim cpxSolver As Solver Set MPL = New OptiMax Set cpxSolver = MPL.Solvers.Add("CPLEX") cpxSolver.Options("AdvanceBasisInd").Value = False MPL.WorkingDirectory = "c:\mplwin4" Set planModel = MPL.Models.Add("Planning") Set dietModel = MPL.Models.Add("Diet") For Each mplModel In MPL.Models Result = mplModel.ReadModel(mplModel.Name) Next mplModel For Each mplModel In MPL.Models Result = mplModel.Solve Next mplModel For Each mplModel In MPL.Models Result = mplModel.Solve Next mplModel
Locates a specific model name, returns the model number. (Method)
Returns a string representing the Models collection. (Method)