Interface IVariableCollection
Defines an interface for accessing generic and non-generic variable collections
Namespace: OPTANO.Modeling.Optimization.Interfaces
Assembly: Optimization.dll
Syntax
public interface IVariableCollection
Properties
ExistingIndices
Gets the existing indices.
Declaration
IEnumerable<object[]> ExistingIndices { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<System.Object[]> | The System.Collections.IEnumerable with all already known indices. I.e. all indices that have already been used to access this VariableCollection. |
IndexValidationStyle
Gets or sets a value indicating whether index validaiton is used.
Changes the behavior of a VariableCollection. If set to true the VariableCollection will validate if an index belongs to the sets the VariableCollection is based on.
The check is computationally expensive and should only be performed when you debug a model.
Declaration
IndexValidationStyle IndexValidationStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| IndexValidationStyle |
Name
Gets the name for this variable collection.
It must be unique among all VariableCollections that are used in a single Model.
Declaration
string Name { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
ValidIndices
Gets an System.Collections.IEnumerable that iterates over all valid index combinations for this VariableCollection.
Declaration
IEnumerable<object[]> ValidIndices { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<System.Object[]> | The valid indices. |
Variables
Gets an System.Collections.IEnumerable that contains all existing Variables in this VariableCollection.
I.e. all variables that were generated when this VariableCollection was accessed with the variables index.
Declaration
IEnumerable<Variable> Variables { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<Variable> | The variables. |
VariableTypeGenerator
Gets a generator delegate that takes an index as input and returns the VariableType for the respective Variable.
Declaration
VariableCollection.VariableTypeGeneratorDelegate VariableTypeGenerator { get; }
Property Value
| Type | Description |
|---|---|
| VariableCollection.VariableTypeGeneratorDelegate |
Methods
IsVariableForIndexInstanciated(Object[])
Checks if a variable was created for the given index.
Declaration
bool IsVariableForIndexInstanciated(params object[] index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object[] | index | The index. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True, if a variable was created. |
SetVariableValues(IDictionary<String, Double>)
Sets the value property for each variable in this VariableCollection to the corresponding value in the values. The matching happens by string comparison of the name of the variable.
Declaration
void SetVariableValues(IDictionary<string, double> values)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IDictionary<System.String, System.Double> | values | The values for the variables (e.g. coming from a Solution) |