Class FrontLineXpressSolver
Solver adapter for the XPRESS SDK 2016 Solver API.
Inheritance
Inherited Members
Namespace: OPTANO.Modeling.Optimization.Solver.FrontLineXpressSDK2016
Assembly: Optimization.Solver.FrontLineXpressSDK2016.dll
Syntax
public class FrontLineXpressSolver : GenericSolverBase<XpressSolverConfiguration>, ISolver, ICanSolve<Model, Solution>, IAbortable, IDisposable
Constructors
FrontLineXpressSolver(XpressSolverConfiguration)
Initializes a new instance of the FrontLineXpressSolver class.
Declaration
public FrontLineXpressSolver(XpressSolverConfiguration config = null)
Parameters
Type | Name | Description |
---|---|---|
XpressSolverConfiguration | config | The configuration. |
Properties
FrontLineProblem
Gets or sets the front line problem.
Declaration
protected Problem FrontLineProblem { get; set; }
Property Value
Type | Description |
---|---|
SolverPlatform.Problem |
IndexToVariable
Gets or sets the variable to the index key.
Declaration
protected Dictionary<int, Variable> IndexToVariable { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<System.Int32, Variable> |
VariableToIndex
Gets or sets the index of the variable key.
Declaration
protected Dictionary<Variable, int> VariableToIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.Dictionary<Variable, System.Int32> |
Methods
Abort()
Aborts the solution process.
Declaration
public override void Abort()
Overrides
AddConstraint(Constraint)
Adds the constraint to the solver model.
Declaration
protected void AddConstraint(Constraint constraint)
Parameters
Type | Name | Description |
---|---|---|
Constraint | constraint | The constraint. |
AddObjective(Objective)
Add/set another objective
Declaration
protected override void AddObjective(Objective objective)
Parameters
Type | Name | Description |
---|---|---|
Objective | objective | The objective. |
Overrides
AddVariable(Variable)
Adds a single variable (and crates a new index).
Declaration
protected int AddVariable(Variable variable)
Parameters
Type | Name | Description |
---|---|---|
Variable | variable | The variable to add. |
Returns
Type | Description |
---|---|
System.Int32 | The index for |
AddVariables(IEnumerable<Variable>)
Initialize the index dictionaries for the given set of variablesToAdd
.
Declaration
protected void AddVariables(IEnumerable<Variable> variablesToAdd)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Variable> | variablesToAdd | The variables to add. |
BuildSolverModelAdapterSpecific(Int32)
Initializes the XpressProblem.
Declaration
protected override void BuildSolverModelAdapterSpecific(int prioLevel = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | prioLevel | The prio level. |
Overrides
CanExportFile(FileInfo, ExportTime, Boolean)
Determines a value indicating whether this solver can export the current _model.
Declaration
protected override bool CanExportFile(FileInfo outputFile, ExportTime exportTime, bool printHints = false)
Parameters
Type | Name | Description |
---|---|---|
System.IO.FileInfo | outputFile | The file to export. |
ExportTime | exportTime | Export before or after solve. |
System.Boolean | printHints |
|
Returns
Type | Description |
---|---|
System.Boolean |
|
Overrides
ClearLastModel()
Clears the last model.
Declaration
public override void ClearLastModel()
Overrides
DisposeCustom()
Disposes the FrontLineProblem.
Declaration
protected override void DisposeCustom()
Overrides
ExportFileSolverSpecific(FileInfo)
The export model solver specific.
Declaration
protected override void ExportFileSolverSpecific(FileInfo outputFile)
Parameters
Type | Name | Description |
---|---|---|
System.IO.FileInfo | outputFile |
Overrides
GetIndexForVariable(Variable)
Gets the index for Variable variable
.
Declaration
protected int GetIndexForVariable(Variable variable)
Parameters
Type | Name | Description |
---|---|---|
Variable | variable | The variable. |
Returns
Type | Description |
---|---|
System.Int32 | The |
GetVariableForIndex(Int32)
Gets the variable for the given index
.
Declaration
protected Variable GetVariableForIndex(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The index of the variable. |
Returns
Type | Description |
---|---|
Variable | The Variable with index |
RemoveConstraint(String)
Removes the constraint with Name ==
from the solver model.name
Declaration
protected override void RemoveConstraint(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The constraint to remove. |
Overrides
SetConfigurationAdapterSpecific()
Set the configuration.
Declaration
protected override void SetConfigurationAdapterSpecific()
Overrides
SolveAdapterSpecific(Int32, IDictionary<Variable, Double>)
Solves the given problem
and returns the Solution
Declaration
protected override Solution SolveAdapterSpecific(int prioLevel = 0, IDictionary<Variable, double> variableValues = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | prioLevel | The prio Level to retrieve the objective. |
System.Collections.Generic.IDictionary<Variable, System.Double> | variableValues |
Returns
Type | Description |
---|---|
Solution | The Solution. |