The Models Collection

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.

Properties for the Models Object

Count

The number of Model objects in the collection. (Integer Property - Read Only)

Item (Index)

Returns the selected Model object. (Object Property)

Methods for the Models Object

Add (Name)

Adds a new Model object to the collection. (Method)

Copy (Name)

Copies the selected Model object and adds it to the collection. (Method)

Delete

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

        

Locate (Name)

Locates a specific model name, returns the model number. (Method)

ToString

Returns a string representing the Models collection. (Method)


Back To Top | Maximal Home Page | Table of Contents | Previous Page | Next Page