Show / Hide Table of Contents

    Class CplexSolver

    Represents a CPLEX solver instance for mathematical programming problems.

    Inheritance
    System.Object
    SolverBase
    GenericSolverBase<CplexSolverConfiguration>
    CplexSolver
    Inherited Members
    GenericSolverBase<CplexSolverConfiguration>.Configuration
    SolverBase._busyLock
    SolverBase.CurrentModel
    SolverBase.TriviallyFeasibleConstraintHandling
    SolverBase.Transformation
    SolverBase._model
    SolverBase.IsMultiHierachicalModel
    SolverBase.SetMultiHierarchicalInterruptionCallback(SolverBase.InterruptMultiHierarchicalOptimization)
    SolverBase.Solve(Model, Dictionary<Variable, Double>)
    SolverBase.CachedMergedObjectives
    SolverBase.GetMergedObjectiveForPriorityLevel(Int32, Boolean)
    SolverBase.GetRelevantObjectivesForPrioLevel(Int32)
    SolverBase.RestoreModel(Solution)
    SolverBase.TransformModel()
    SolverBase.SetTimelimitAndGapForCurrentStage(Int32, TimeSpan, Double)
    SolverBase.Dispose()
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: OPTANO.Modeling.Optimization.Solver.Cplex126
    Assembly: Optimization.Solver.Cplex126.dll
    Syntax
    public class CplexSolver : GenericSolverBase<CplexSolverConfiguration>, ICanManipulateANativeSolver, ICanSetCutOff, ISolver, ICanSolve<Model, Solution>, IAbortable, ICplexBranchedCallback, IStatus<StatusInfo>, IDisposable

    Constructors

    CplexSolver(CplexSolverConfiguration)

    Initializes a new instance of the CplexSolver class. In order to use the CplexSolver in your project, make sure to reference the ILOG.CPLEX.dll and ILOG.Concert.DLL from the CPLEX installation folder.

    Declaration
    public CplexSolver(CplexSolverConfiguration configuration = null)
    Parameters
    Type Name Description
    CplexSolverConfiguration configuration

    The configuration.

    Methods

    Abort()

    If this SolverBase instance , abort the run as soon as possible, or do nothing if this solver instance is not busy.

    Declaration
    public override void Abort()
    Overrides
    SolverBase.Abort()
    Implements
    IAbortable.Abort()

    AddConstraint(Constraint)

    The add constraint.

    Declaration
    protected void AddConstraint(Constraint constraint)
    Parameters
    Type Name Description
    Constraint constraint

    The constraint.

    Exceptions
    Type Condition
    System.ArgumentNullException

    AddObjective(Objective)

    The add objective.

    Declaration
    protected override void AddObjective(Objective objective)
    Parameters
    Type Name Description
    Objective objective

    The objective.

    Overrides
    SolverBase.AddObjective(Objective)

    BuildSolverModelAdapterSpecific(Int32)

    Initializes the solver instance and then builds the ILOG.CPLEX.CpxModel.

    Declaration
    protected override void BuildSolverModelAdapterSpecific(int prioLevel = 0)
    Parameters
    Type Name Description
    System.Int32 prioLevel

    The prio level.

    Overrides
    SolverBase.BuildSolverModelAdapterSpecific(Int32)

    CanExportFile(FileInfo, ExportTime, Boolean)

    True, if ModelOutputFile is not null and has any extension.

    Declaration
    protected override bool CanExportFile(FileInfo outputFile, ExportTime exportTime, bool printHints = false)
    Parameters
    Type Name Description
    System.IO.FileInfo outputFile

    The file to check.

    ExportTime exportTime

    Export before or after solve.

    System.Boolean printHints

    The print hints.

    Returns
    Type Description
    System.Boolean

    The System.Boolean.

    Overrides
    SolverBase.CanExportFile(FileInfo, ExportTime, Boolean)

    ClearLastModel()

    Deletes the internal datastructures of this SolverBase instance.

    Declaration
    public override void ClearLastModel()
    Overrides
    SolverBase.ClearLastModel()
    Implements
    ISolver.ClearLastModel()
    Exceptions
    Type Condition
    System.InvalidOperationException

    If this SolverBase instance .

    Dispose(Boolean)

    The dispose.

    Declaration
    protected void Dispose(bool freeManagedObjectsAlso)
    Parameters
    Type Name Description
    System.Boolean freeManagedObjectsAlso

    true, if managed objects should also be disposed.

    DisposeCustom()

    Disposes this solver instance.

    Declaration
    protected override void DisposeCustom()
    Overrides
    SolverBase.DisposeCustom()

    ExportFileSolverSpecific(FileInfo)

    Export the model solver specific.

    Declaration
    protected override void ExportFileSolverSpecific(FileInfo filteredFileToWrite)
    Parameters
    Type Name Description
    System.IO.FileInfo filteredFileToWrite
    Overrides
    SolverBase.ExportFileSolverSpecific(FileInfo)

    RebuildSolverModelAdapterSpecific(Int32)

    Model is already built up and up to date due to OPTANO.Modeling.Optimization.Solver.Interfaces.ICanManipulateANativeSolver.

    Declaration
    protected override void RebuildSolverModelAdapterSpecific(int prioLevel = 0)
    Parameters
    Type Name Description
    System.Int32 prioLevel

    The prio level.

    Overrides
    SolverBase.RebuildSolverModelAdapterSpecific(Int32)

    RemoveConstraint(String)

    Removes the Constraint with Name == name.

    Declaration
    protected override void RemoveConstraint(string name)
    Parameters
    Type Name Description
    System.String name

    The name of the Constraint to remove.

    Overrides
    SolverBase.RemoveConstraint(String)

    ResolveAdapterSpecific(Int32, IDictionary<Variable, Double>)

    The resolve adapter specific.

    Declaration
    protected override Solution ResolveAdapterSpecific(int prioLevel = 0, IDictionary<Variable, double> variableValues = null)
    Parameters
    Type Name Description
    System.Int32 prioLevel

    The prio level.

    System.Collections.Generic.IDictionary<Variable, System.Double> variableValues

    The variable values.

    Returns
    Type Description
    Solution

    The Solution.

    Overrides
    SolverBase.ResolveAdapterSpecific(Int32, IDictionary<Variable, Double>)

    SetBranchingDirectionAdapterSpecific()

    Sets the BranchingDirection adapter specific.

    Declaration
    protected override void SetBranchingDirectionAdapterSpecific()
    Overrides
    SolverBase.SetBranchingDirectionAdapterSpecific()

    SetBranchingPriorityAdapterSpecific()

    Set the BranchingPriority adapter specific.

    Declaration
    protected override void SetBranchingPriorityAdapterSpecific()
    Overrides
    SolverBase.SetBranchingPriorityAdapterSpecific()

    SetConfigurationAdapterSpecific()

    Sets the configuration parameters in OPTANO.Modeling.Optimization.Solver.Cplex126.CplexSolver.Cplex environment.

    Declaration
    protected override void SetConfigurationAdapterSpecific()
    Overrides
    SolverBase.SetConfigurationAdapterSpecific()

    SolveAdapterSpecific(Int32, IDictionary<Variable, Double>)

    Solves the CurrentModel. Optimizes if CurrentModel contains at least one Objective.

    Declaration
    protected override Solution SolveAdapterSpecific(int prioLevel = 0, IDictionary<Variable, double> variableValues = null)
    Parameters
    Type Name Description
    System.Int32 prioLevel

    The priority level to solve for.

    System.Collections.Generic.IDictionary<Variable, System.Double> variableValues

    Initial values for all or a subset of variables in the Model

    Returns
    Type Description
    Solution

    The Solution. Note that the solution does not always contain values, since the model might be Infeasible.

    Overrides
    SolverBase.SolveAdapterSpecific(Int32, IDictionary<Variable, Double>)
    Exceptions
    Type Condition
    System.NotSupportedException

    If this solver instance not supports solving.

    System.InvalidOperationException

    If this solver instance is busy.

    Events

    Branched

    Occurs when Cplex branches on a node.

    Declaration
    public event EventHandler<CplexBranchingEventArgs> Branched
    Event Type
    Type Description
    System.EventHandler<CplexBranchingEventArgs>
    Implements
    ICplexBranchedCallback.Branched

    Status

    The status callback during the solution process.

    Declaration
    public event Action<StatusInfo> Status
    Event Type
    Type Description
    System.Action<StatusInfo>
    Implements
    IStatus<T>.Status

    Explicit Interface Implementations

    ICanSetCutOff.SetCutOff

    Gets or sets the set cut off.

    Declaration
    Func<double> ICanSetCutOff.SetCutOff { get; set; }
    Returns
    Type Description
    System.Func<System.Double>
    Implements
    ICanSetCutOff.SetCutOff

    Extension Methods

    ReflectionHelper.GetFieldValue(Object, String)
    ReflectionHelper.SetFieldValue(Object, String, Object)
    ExtensionMethods.Clone<T>(T)
    ExtensionMethods.ThrowIfArgumentIsNull<T>(T, String)
    Back to top Copyright © OPTANO GmbH generated with DocFX
    Privacy Policy | Impressum – Legal Notice