Class VariableCollection<T, T2, T3, T4, T5, T6, T7>
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> : GenericVariableCollectionBase<VariableCollection<T, T2, T3, T4, T5, T6, T7>>, 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. |
Constructors
VariableCollection(Model, IEnumerable<T>, IEnumerable<T2>, IEnumerable<T3>, IEnumerable<T4>, IEnumerable<T5>, IEnumerable<T6>, IEnumerable<T7>, String, Func<T, T2, T3, T4, T5, T6, T7, String>, Func<T, T2, T3, T4, T5, T6, T7, Double>, Func<T, T2, T3, T4, T5, T6, T7, Double>, Func<T, T2, T3, T4, T5, T6, T7, VariableType>, Func<T, T2, T3, T4, T5, T6, T7, Nullable<Int32>>, Func<T, T2, T3, T4, T5, T6, T7, BranchingDirection>)
Initializes a new instance of the VariableCollection<T, T2, T3, T4, T5, T6, T7> class. Initializes a new instance of the VariableCollection<T, T2, T3, T4, T5, T6, T7> 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, string name = "", Func<T, T2, T3, T4, T5, T6, T7, string> debugNameGenerator = null, Func<T, T2, T3, T4, T5, T6, T7, double> lowerBoundGenerator = null, Func<T, T2, T3, T4, T5, T6, T7, double> upperBoundGenerator = null, Func<T, T2, T3, T4, T5, T6, T7, VariableType> variableTypeGenerator = null, Func<T, T2, T3, T4, T5, T6, T7, int? > branchingPriorityGenerator = null, Func<T, T2, T3, T4, T5, T6, T7, BranchingDirection> branchingDirectionGenerator = null)
Parameters
Type | Name | Description |
---|---|---|
Model | model | The Model this VariableCollection<T, T2, T3, T4, T5, T6, T7> belongs to. A VariableCollection<T, T2, T3, T4, T5, T6, T7> 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.String | name | The name for this variable collection.
It must be |
System.Func<T, T2, T3, T4, T5, T6, T7, System.String> | debugNameGenerator | A function that takes an |
System.Func<T, T2, T3, T4, T5, T6, T7, System.Double> | lowerBoundGenerator | A function that takes an |
System.Func<T, T2, T3, T4, T5, T6, T7, System.Double> | upperBoundGenerator | A function that takes an |
System.Func<T, T2, T3, T4, T5, T6, T7, VariableType> | variableTypeGenerator | A function that takes an |
System.Func<T, T2, T3, T4, T5, T6, T7, 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, 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, T4, T5, T6, T7>> ExistingIndicesGeneric { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7>> |
Item[T, T2, T3, T4, T5, T6, T7]
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] { 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 |
Property Value
Type | Description |
---|---|
Variable | The variable for the given |
Item[GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7>]
Gets the Variable with the specified index
.
Declaration
public Variable this[GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7> index] { get; }
Parameters
Type | Name | Description |
---|---|---|
GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7> | 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> CreateTypedInstance(VariableCollection internalCollection)
Parameters
Type | Name | Description |
---|---|---|
VariableCollection | internalCollection |
Returns
Type | Description |
---|---|
VariableCollection<T, T2, T3, T4, T5, T6, T7> |
Overrides
IsVariableForIndexInstanciated(GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7>)
Checks if a variable was created for the given index.
Declaration
public bool IsVariableForIndexInstanciated(GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7> genericIndex)
Parameters
Type | Name | Description |
---|---|---|
GenericVariableCollectionIndex<T, T2, T3, T4, T5, T6, T7> | genericIndex | The index. |
Returns
Type | Description |
---|---|
System.Boolean | True, if a variable was created. |