The Solver Object

The Solver object is an element of the Solvers collection and contains all the information stored about each solver that is loaded in OptiMax.

Collections contained by the Solver Object

Options

Returns the SolverOptions collection for the solver. (Object Property)

Properties for the Solver Object

Filename

The filename for the solver. (String Property - Read Only)

Name

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

Pathname

The full pathname for the solver. (String Property - Read Only)

CSharp Example:


     OptiMax MPL;
     Solver cpxSolver;
     Model planModel;
     Solution planSol;
     ResultType result;

     MPL = new OptiMax();

     cpxSolver = MPL.Solvers.Add("CPLEX");
     planModel = MPL.Models.Add("Planning");

     string WorkingDirectory = "c:\\mplwin4";
     string modFilePath = WorkingDirectory + "\\" + "Planning.mpl";
     planSol = planModel.Solution;

     result = planModel.ReadModel(modFilePath);
     result = planModel.Solve(cpxSolver);
     Console.WriteLine("ResultString     = " + planSol.ResultString);
     Console.WriteLine("ObjectValue      = " + planSol.ObjectValue);
     Console.WriteLine("IsAvailable      = " + planSol.IsAvailable);
     Console.WriteLine("IsRangesAvail    = " + planSol.IsRangesAvailable);
     Console.WriteLine("Variable Count   = " + planSol.VarCount);
     Console.WriteLine("Constraint Count = " + planSol.ConCount);
     Console.WriteLine("Iteration Count  = " + planSol.IterationCount);
     Console.WriteLine("Node Count       = " + planSol.MipNodeCount);
     Console.WriteLine("Solver Time      = " + planSol.SolverTime);

        

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