Class VariableCollection<T, T2, T3, T4, T5, T6, T7, T8>
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, T4, T5, T6, T7, T8> : GenericVariableCollectionBase<VariableCollection<T, T2, T3, T4, T5, T6, T7, T8>>, 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. |
T4 | Element type for the 4th index set. |
T5 | Element type for the 5th index set. |
T6 | Element type for the 6th index set. |
T7 | Element type for the 7th index set. |
T8 | Element type for the 8th index set. |
Constructors
VariableCollection(Model, IEnumerable<T>, IEnumerable<T2>, IEnumerable<T3>, IEnumerable<T4>, IEnumerable<T5>, IEnumerable<T6>, IEnumerable<T7>, IEnumerable<T8>, String, Func<T, T2, T3, T4, T5, T6, T7, T8, String>, Func<T, T2, T3, T4, T5, T6, T7, T8, Double>, Func<T, T2, T3, T4, T5, T6, T7, T8, Double>, Func<T, T2, T3, T4, T5, T6, T7, T8, VariableType>, Func<T, T2, T3, T4, T5, T6, T7, T8, Nullable<Int32>>, Func<T, T2, T3, T4, T5, T6, T7, T8, BranchingDirection>)
Initializes a new instance of the VariableCollection<T, T2, T3, T4, T5, T6, T7, T8> class. Initializes a new instance of the VariableCollection<T, T2, T3, T4, T5, T6, T7, T8> class.
Declaration
public VariableCollection(Model model, IEnumerable<T> indexSet1, IEnumerable<T2> indexSet2, IEnumerable<T3> indexSet3, IEnumerable<T4> indexSet4, IEnumerable<T5> indexSet5, IEnumerable<T6> indexSet6, IEnumerable<T7> indexSet7, IEnumerable<T8> indexSet8, string name = "", Func<T, T2, T3, T4, T5, T6, T7, T8, string> debugNameGenerator = null, Func<T, T2, T3, T4, T5, T6, T7, T8, double> lowerBoundGenerator = null, Func<T, T2, T3, T4, T5, T6, T7, T8, double> upperBoundGenerator = null, Func<T, T2, T3, T4, T5, T6, T7, T8, VariableType> variableTypeGenerator = null, Func<T, T2, T3, T4, T5, T6, T7, T8, int? > branchingPriorityGenerator = null, Func<T, T2, T3, T4, T5, T6, T7, T8, BranchingDirection> branchingDirectionGenerator = null)
Parameters
Type | Name | Description |
---|---|---|
Model | model | The Model this VariableCollection<T, T2, T3, T4, T5, T6, T7, T8> belongs to. A VariableCollection<T, T2, T3, T4, T5, T6, T7, T8> 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.Collections.Generic.IEnumerable<T4> | indexSet4 | The index set with elements of type |
System.Collections.Generic.IEnumerable<T5> | indexSet5 | The index set with elements of type |
System.Collections.Generic.IEnumerable<T6> | indexSet6 | The index set with elements of type |
System.Collections.Generic.IEnumerable<T7> | indexSet7 | The index set with elements of type |
System.Collections.Generic.IEnumerable<T8> | indexSet8 | The index set with elements of type |
System.String | name | The name for this variable collection.
It must be |
System.Func<T, T2, T3, T4, T5, T6, T7, T8, System.String> | debugNameGenerator | A function that takes an |
System.Func<T, T2, T3, T4, T5, T6, T7, T8, System.Double> | lowerBoundGenerator | A function that takes an |
System.Func<T, T2, T3, T4, T5, T6, T7, T8, System.Double> | upperBoundGenerator | A function that takes an |
System.Func<T, T2, T3, T4, T5, T6, T7, T8, VariableType> | variableTypeGenerator | A function that takes an |
System.Func<T, T2, T3, T4, T5, T6, T7, T8, 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, T4, T5, T6, T7, T8, BranchingDirection> | branchingDirectionGenerator | A function that takes an element from each index set and returns the branching direction as BranchingDirection (or |
Properties
ExistingIndicesGeneric
Returns all existing indices as generically typed index object.
Declaration
public IEnumerable<GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7, T8>> ExistingIndicesGeneric { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7, T8>> |
Item[T, T2, T3, T4, T5, T6, T7, T8]
Gets the Variable with the specified index
.
Declaration
public Variable this[T element1, T2 element2, T3 element3, T4 element4, T5 element5, T6 element6, T7 element7, T8 element8] { get; }
Parameters
Type | Name | Description |
---|---|---|
T | element1 | Element of the index |
T2 | element2 | Element of the index |
T3 | element3 | Element of the index |
T4 | element4 | Element of the index |
T5 | element5 | Element of the index |
T6 | element6 | Element of the index |
T7 | element7 | Element of the index |
T8 | element8 | Element of the index |
Property Value
Type | Description |
---|---|
Variable | The variable for the given |
Item[GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7, T8>]
Gets the Variable with the specified index
.
Declaration
public Variable this[GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7, T8> index] { get; }
Parameters
Type | Name | Description |
---|---|---|
GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7, T8> | index | All index elements combined in a single tuple. |
Property Value
Type | Description |
---|---|
Variable |
Methods
CreateTypedInstance(VariableCollection)
Declaration
protected override VariableCollection<T, T2, T3, T4, T5, T6, T7, T8> CreateTypedInstance(VariableCollection internalCollection)
Parameters
Type | Name | Description |
---|---|---|
VariableCollection | internalCollection |
Returns
Type | Description |
---|---|
VariableCollection<T, T2, T3, T4, T5, T6, T7, T8> |
Overrides
IsVariableForIndexInstanciated(GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7, T8>)
Checks if a variable was created for the given index.
Declaration
public bool IsVariableForIndexInstanciated(GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7, T8> genericIndex)
Parameters
Type | Name | Description |
---|---|---|
GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7, T8> | genericIndex | The index. |
Returns
Type | Description |
---|---|
System.Boolean | True, if a variable was created. |