Class VariableCollection<T, T2, T3>
This is a strongly typed
helper class that allows you to model your Variables more intuitively
It groups variable with the same meaning.
In a mathematical model a VariableCollection is represented by a single symbol (like x
); a variable by a symbol with indices (like x_{i,j}
).
Some (optional) generators are used to calculate parameters for each of the VariableCollection's variable:
DebugNameGenerator
LowerBoundGenerator
UpperBoundGenerator
VariableTypeGenerator
BranchingPriorityGenerator
Inheritance
Inherited Members
Namespace: OPTANO.Modeling.Optimization
Assembly: Optimization.dll
Syntax
public class VariableCollection<T, T2, T3> : GenericVariableCollectionBase<VariableCollection<T, T2, T3>>, IInternalVariableCollection, IVariableCollection
Type Parameters
Name | Description |
---|---|
T | Element type for the 1st index set. |
T2 | Element type for the 2nd index set. |
T3 | Element type for the 3rd index set. |
Constructors
VariableCollection(Model, IEnumerable<T>, IEnumerable<T2>, IEnumerable<T3>, String, Func<T, T2, T3, String>, Func<T, T2, T3, Double>, Func<T, T2, T3, Double>, Func<T, T2, T3, VariableType>, Func<T, T2, T3, Nullable<Int32>>, Func<T, T2, T3, BranchingDirection>)
Initializes a new instance of the VariableCollection<T, T2, T3> class. Initializes a new instance of the VariableCollection<T, T2, T3> class.
Declaration
public VariableCollection(Model model, IEnumerable<T> indexSet1, IEnumerable<T2> indexSet2, IEnumerable<T3> indexSet3, string name = "", Func<T, T2, T3, string> debugNameGenerator = null, Func<T, T2, T3, double> lowerBoundGenerator = null, Func<T, T2, T3, double> upperBoundGenerator = null, Func<T, T2, T3, VariableType> variableTypeGenerator = null, Func<T, T2, T3, int? > branchingPriorityGenerator = null, Func<T, T2, T3, BranchingDirection> branchingDirectionGenerator = null)
Parameters
Type | Name | Description |
---|---|---|
Model | model | The Model this VariableCollection<T, T2, T3> belongs to. A VariableCollection<T, T2, T3> needs to belong to exactly one Model. |
System.Collections.Generic.IEnumerable<T> | indexSet1 | The index set with elements of type |
System.Collections.Generic.IEnumerable<T2> | indexSet2 | The index set with elements of type |
System.Collections.Generic.IEnumerable<T3> | indexSet3 | The index set with elements of type |
System.String | name | The name for this variable collection.
It must be |
System.Func<T, T2, T3, System.String> | debugNameGenerator | A function that takes an |
System.Func<T, T2, T3, System.Double> | lowerBoundGenerator | A function that takes an |
System.Func<T, T2, T3, System.Double> | upperBoundGenerator | A function that takes an |
System.Func<T, T2, T3, VariableType> | variableTypeGenerator | A function that takes an |
System.Func<T, T2, T3, System.Nullable<System.Int32>> | branchingPriorityGenerator | A function that takes an element from each index set and returns the branching priority as integer (or |
System.Func<T, T2, T3, BranchingDirection> | branchingDirectionGenerator | A function that takes an element from each index set and returns the branching priority as integer (or |
Properties
ExistingIndicesGeneric
Returns all existing indices as generically typed index object.
Declaration
public IEnumerable<GenericVariableCollectionIndex<T, T2, T3>> ExistingIndicesGeneric { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<GenericVariableCollectionIndex<T, T2, T3>> |
Item[T, T2, T3]
Gets the Variable with the specified index
.
Declaration
public Variable this[T element1, T2 element2, T3 element3] { get; }
Parameters
Type | Name | Description |
---|---|---|
T | element1 | Element of the index |
T2 | element2 | Element of the index |
T3 | element3 | Element of the index |
Property Value
Type | Description |
---|---|
Variable | The variable for the given |
Item[GenericVariableCollectionIndex<T, T2, T3>]
Gets the Variable with the specified index
.
Declaration
public Variable this[GenericVariableCollectionIndex<T, T2, T3> index] { get; }
Parameters
Type | Name | Description |
---|---|---|
GenericVariableCollectionIndex<T, T2, T3> | index | All index elements combined in a single tuple. |
Property Value
Type | Description |
---|---|
Variable |
Methods
CreateTypedInstance(VariableCollection)
Declaration
protected override VariableCollection<T, T2, T3> CreateTypedInstance(VariableCollection internalCollection)
Parameters
Type | Name | Description |
---|---|---|
VariableCollection | internalCollection |
Returns
Type | Description |
---|---|
VariableCollection<T, T2, T3> |
Overrides
IsVariableForIndexInstanciated(GenericVariableCollectionIndex<T, T2, T3>)
Checks if a variable was created for the given index.
Declaration
public bool IsVariableForIndexInstanciated(GenericVariableCollectionIndex<T, T2, T3> genericIndex)
Parameters
Type | Name | Description |
---|---|---|
GenericVariableCollectionIndex<T, T2, T3> | genericIndex | The index. |
Returns
Type | Description |
---|---|
System.Boolean | True, if a variable was created. |