The Solution Object

The Solution object is a property of the parent Model object and contains all the information stored about the solution for the model. The Solution object properties are only available after the model has been solved.

Collections contained by the Solution Object

Constraints

Returns the Constraints collection for the solution.

Variables

Returns the Variables collection for the solution.

Properties for the Solution Object

ConCount

The number of constraints in the solution. (Integer Property - Read Only)

DataImportTime

How long time in seconds it took to import data for the model. (Double Property - Read Only)

ExportSolTime

How long time in seconds it took to export the solution. (Double Property - Read Only)

IsAvailable

Specifies if the solution values are available for retrieval. (Boolean Property - Read/Write)

IsRangesAvailable

Specifies if the solution ranges are available for retrieval. (Boolean Property - Read/Write)

IterationCount

The iteration count of the solver run. (Integer Property - Read Only)

MipBestBound

The best bound of the MIP objective value. (Double Property - Read Only)

MipImproveCount

The MIP improve node count of the solver run. (Integer Property - Read Only)

MipImproveTime

How long time in seconds it took to search for improved MIP solutions. (Double Property - Read Only)

NodeCount

The MIP node count of the solver run. (Integer Proprety - Read Only)

ObjectValue

The value of the objective function for the solution. (Double Property - Read/Only)

ParserTime

How long time in seconds it took MPL to parse in the model. (Double Property - Read Only)

ResultCode

The native solver result code of the solver run. (Integer Property - Read Only)

ResultString

The result of the solver run. (String Property - Read Only)

SolverTime

How long time in seconds it took to solve the model. (Double Property - Read Only)

TotalTime

How long total time in seconds it took to run the model. (Double Property - Read Only)

VarCount

The number of variables in the solution. (Integer Property - Read Only)

Visual Basic Example:


     Dim MPL As OptiMax
     Dim cpxSolver As Solver
     Dim planModel As Model
     Dim planSol As Solution


     Set MPL = New OptiMax
     Set planModel = MPL.Models.Add("Planning")

     Set planSol = planModel.Solution

     MPL.WorkingDirectory = "c:\mplwin4"
     MPL.Solvers.Add ("c:\mplwin4\CPLEX65.dll")
     Result = planModel.ReadModel("planModel.Name")
     Result = planModel.Solve

     Debug.Print "ResultString     = " & planSol.ResultString
     Debug.Print "ObjectValue      = " & planSol.ObjectValue
     Debug.Print "IsAvailable      = " & CBool(planSol.IsAvailable)

     Debug.Print "IsRangesAvail    = " & CBool(planSol.IsRangesAvailable)
     Debug.Print "Variable Count   = " & planSol.VarCount
     Debug.Print "Constraint Count = " & planSol.ConCount
     Debug.Print "Iteration Count  = " & planSol.IterationCount
     Debug.Print "Node Count       = " & planSol.NodeCount
     Debug.Print "Solver Time      = " & planSol.SolverTime

        

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