Optimization Model Class
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
public abstract class OptimizationModel
- Inheritance
- Object → OptimizationModel
- Derived
Remarks
The OptimizationModel class serves as the abstract base class for classes that represent optimization models.
A model has variables and constraints. They are made available through the Variables and Constraints properties. These collections are indexed by name and by position. The types of constraints that are allowed depend on the concrete class.
OptimizationModel instances cannot be created directly. Instead, create an instance of one of the derivived classes:
Class | Purpose |
---|---|
Linear | Optimize a linear objective function subject to linear constraints. |
Quadratic | Optimize a quadratic objective function subject to linear constraints. |
Nonlinear | Optimize a possibly nonlinear objective function subject to both linear and nonlinear constraints. |
The Solve() method solves the optimization model using a dual Revised Simplex Method. Note that this operation can take a long time for large problems or difficult problems. Most problems up to several hundred variables are solved within a fraction of a second. The Status property returns a OptimizationModelStatus value that indicates the result of the calculation. A value of Optimal indicates an optimal solution was found.
The Solve() method returns a Vector containing the optimal values for the variables. The values of the variables are also avaialble through the Value property of the variables. The OptimalValue property returns the optimal value.
Constructors
Optimization | Constructs a new OptimizationModel object. |
Optimization | Constructs an optimization model with linear constraints in standard form. |
Optimization | Constructs an optimization model with linear constraints in standard form. |
Optimization | Constructs an optimization model with linear constraints in standard form. |
Properties
Constraints | Gets the collection of constraints for this OptimizationModel. |
Extremum | Gets or sets whether a minimum or a maximum should be computed. |
Name | Gets or sets the name of the model. |
Optimal | Gets the extreme value of the cost function. |
Solution | Gets an object that contains information about the solution of the model. |
Status | Gets the status of the optimization model's solution. |
Variables | Gets the collection of variables for this OptimizationModel. |
Methods
Add | Adds a binary variable to the collection. |
Add | Adds an integer variable to the collection. |
Add | Adds a binary variable to the collection. |
Add | Adds a linear constraint to the optimization model. |
Add | Adds a linear constraint to the optimization model. |
Add | Adds a linear constraint to the optimization model. |
Add | Adds a linear constraint to the optimization model. |
Add | Adds a linear constraint to the optimization model. |
Add | Adds a linear constraint to the optimization model. |
Add | Adds a variable to the collection. |
Add | Adds a variable to the collection. |
Create | Creates linear constraints based on the specified coefficients. |
Create | Creates linear constraints based on the specified coefficients and bounds. |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) |
Get | Serves as the default hash function. (Inherited from Object) |
Get | Gets the solution to the optimization model. |
Get | Gets the Type of the current instance. (Inherited from Object) |
Memberwise | Creates a shallow copy of the current Object. (Inherited from Object) |
OnAdd | Notifies the optimization model that a constraint has been added. |
OnAdd | Notifies the optimization model that a variable has been added. |
OnRemove | Notifies the optimization model that all constraints has been removed. |
OnRemove | Notifies the optimization model that all variables has been removed. |
OnRemove | Notifies the optimization model that a constraint has been removed. |
OnRemove | Notifies the optimization model that a variable has been removed. |
Solve | Solves the model and returns the solution. |
Solve | Solves the model and returns a report detailing the solution. |
ToString | Returns a string that represents the current object. (Inherited from Object) |