SimplexSolver.GetReport Method (LinearSolverReportType)
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Gets a sensitivity report associated with a solve attempt.
Namespace: Microsoft.SolverFoundation.Solvers
Assembly: Microsoft.Solver.Foundation (in Microsoft.Solver.Foundation.dll)
Syntax
'Declaration
Public Overridable Function GetReport ( _
reportType As LinearSolverReportType _
) As ILinearSolverReport
public virtual ILinearSolverReport GetReport(
LinearSolverReportType reportType
)
public:
virtual ILinearSolverReport^ GetReport(
LinearSolverReportType reportType
)
abstract GetReport :
reportType:LinearSolverReportType -> ILinearSolverReport
override GetReport :
reportType:LinearSolverReportType -> ILinearSolverReport
public function GetReport(
reportType : LinearSolverReportType
) : ILinearSolverReport
Parameters
- reportType
Type: Microsoft.SolverFoundation.Services.LinearSolverReportType
The report type.
Return Value
Type: Microsoft.SolverFoundation.Services.ILinearSolverReport
A linear solver report.
Implements
ILinearSolver.GetReport(LinearSolverReportType)
Examples
The following code examples show how to create a model, add constraints and goals, solve the model, and get a short report. For more information, see How to: Use Linear Programming using the Solver Foundation Solver APIs.
Imports Microsoft.SolverFoundation.Common
Imports Microsoft.SolverFoundation.Solvers
using Microsoft.SolverFoundation.Common;
using Microsoft.SolverFoundation.Solvers;
Dim solver As New SimplexSolver()
Dim savid As Integer, vzvid As Integer
solver.AddVariable("Saudi Arabia", savid)
solver.SetBounds(savid, 0, 9000)
solver.AddVariable("Venezuela", vzvid)
solver.SetBounds(vzvid, 0, 6000)
Dim gasoline As Integer, jetfuel As Integer, machinelubricant As Integer, cost As Integer
solver.AddRow("gasoline", gasoline)
solver.AddRow("jetfuel", jetfuel)
solver.AddRow("machinelubricant", machinelubricant)
solver.AddRow("cost", cost)
solver.SetCoefficient(gasoline, savid, 0.3)
solver.SetCoefficient(gasoline, vzvid, 0.4)
solver.SetBounds(gasoline, 2000, Rational.PositiveInfinity)
solver.SetCoefficient(jetfuel, savid, 0.4)
solver.SetCoefficient(jetfuel, vzvid, 0.2)
solver.SetBounds(jetfuel, 1500, Rational.PositiveInfinity)
solver.SetCoefficient(machinelubricant, savid, 0.2)
solver.SetCoefficient(machinelubricant, vzvid, 0.3)
solver.SetBounds(machinelubricant, 500, Rational.PositiveInfinity)
solver.SetCoefficient(cost, savid, 20)
solver.SetCoefficient(cost, vzvid, 15)
solver.AddGoal(cost, 1, True)
solver.Solve(New SimplexSolverParams())
Console.WriteLine("SA {0}, VZ {1}, Gasoline {2}, Jet Fuel {3}, Machine Lubricant {4}, Cost {5}",
solver.GetValue(savid).ToDouble(),
solver.GetValue(vzvid).ToDouble(),
solver.GetValue(gasoline).ToDouble(),
solver.GetValue(jetfuel).ToDouble(),
solver.GetValue(machinelubricant).ToDouble(),
solver.GetValue(cost).ToDouble())
Console.ReadLine()
SimplexSolver solver = new SimplexSolver();
int savid, vzvid;
solver.AddVariable("Saudi Arabia", out savid);
solver.SetBounds(savid, 0, 9000);
solver.AddVariable("Venezuela", out vzvid);
solver.SetBounds(vzvid, 0, 6000);
int gasoline, jetfuel, machinelubricant, cost;
solver.AddRow("gasoline", out gasoline);
solver.AddRow("jetfuel", out jetfuel);
solver.AddRow("machinelubricant", out machinelubricant);
solver.AddRow("cost", out cost);
solver.SetCoefficient(gasoline, savid, 0.3);
solver.SetCoefficient(gasoline, vzvid, 0.4);
solver.SetBounds(gasoline, 2000, Rational.PositiveInfinity);
solver.SetCoefficient(jetfuel, savid, 0.4);
solver.SetCoefficient(jetfuel, vzvid, 0.2);
solver.SetBounds(jetfuel, 1500, Rational.PositiveInfinity);
solver.SetCoefficient(machinelubricant, savid, 0.2);
solver.SetCoefficient(machinelubricant, vzvid, 0.3);
solver.SetBounds(machinelubricant, 500, Rational.PositiveInfinity);
solver.SetCoefficient(cost, savid, 20);
solver.SetCoefficient(cost, vzvid, 15);
solver.AddGoal(cost, 1, true);
solver.Solve(new SimplexSolverParams());
Console.WriteLine("SA {0}, VZ {1}, Gasoline {2}, Jet Fuel {3}, Machine Lubricant {4}, Cost {5}",
solver.GetValue(savid).ToDouble(),
solver.GetValue(vzvid).ToDouble(),
solver.GetValue(gasoline).ToDouble(),
solver.GetValue(jetfuel).ToDouble(),
solver.GetValue(machinelubricant).ToDouble(),
solver.GetValue(cost).ToDouble());
Console.ReadLine();
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.