Show / Hide Table of Contents

    Class GenericVariableCollectionBase<TGenericCollection>

    The base class for all generic VariableCollection classes

    Inheritance
    System.Object
    GenericVariableCollectionBase<TGenericCollection>
    VariableCollection<T>
    VariableCollection<T, T2>
    VariableCollection<T, T2, T3>
    VariableCollection<T, T2, T3, T4>
    VariableCollection<T, T2, T3, T4, T5>
    VariableCollection<T, T2, T3, T4, T5, T6>
    VariableCollection<T, T2, T3, T4, T5, T6, T7>
    VariableCollection<T, T2, T3, T4, T5, T6, T7, T8>
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: OPTANO.Modeling.Optimization
    Assembly: Optimization.dll
    Syntax
    [Serializable]
    public abstract class GenericVariableCollectionBase<TGenericCollection> : IInternalVariableCollection, IVariableCollection where TGenericCollection : GenericVariableCollectionBase<TGenericCollection>
    Type Parameters
    Name Description
    TGenericCollection

    Constructors

    GenericVariableCollectionBase()

    Empty default constructor. Does nothing.

    Declaration
    protected GenericVariableCollectionBase()

    Fields

    _internalVariableCollection

    Variable Collection that is used internally.

    Declaration
    protected VariableCollection _internalVariableCollection
    Field Value
    Type Description
    VariableCollection

    Properties

    ExistingIndices

    Gets the existing indices.

    Declaration
    public 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 .

    Implements
    IVariableCollection.ExistingIndices

    IndexValidationStyle

    Changes the behavior of a . If set to true the will validate if an index belongs to the sets the is based on. The check is computationally expensive and should only be performed when you debug a model.

    Declaration
    public IndexValidationStyle IndexValidationStyle { get; set; }
    Property Value
    Type Description
    IndexValidationStyle
    Implements
    IVariableCollection.IndexValidationStyle

    Name

    Gets the name of the .

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    System.String
    Implements
    IVariableCollection.Name

    ValidIndices

    Gets an System.Collections.IEnumerable that iterates over all valid index combinations for this .

    Declaration
    public IEnumerable<object[]> ValidIndices { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<System.Object[]>

    The valid indices.

    Implements
    IVariableCollection.ValidIndices

    Variables

    Gets an System.Collections.IEnumerable that contains all existing Variables in this . I.e. all variables that were generated when this was accessed with the variables index.

    Declaration
    public IEnumerable<Variable> Variables { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<Variable>

    The variables.

    Implements
    IVariableCollection.Variables

    VariableTypeGenerator

    Gets a generator delegate that takes an index as input and returns the VariableType for the respective Variable.

    Declaration
    public VariableCollection.VariableTypeGeneratorDelegate VariableTypeGenerator { get; }
    Property Value
    Type Description
    VariableCollection.VariableTypeGeneratorDelegate
    Implements
    IVariableCollection.VariableTypeGenerator

    Methods

    CheckIfVariableForIndexExists(GenericVariableCollectionIndexBase)

    Declaration
    protected bool CheckIfVariableForIndexExists(GenericVariableCollectionIndexBase genericIndex)
    Parameters
    Type Name Description
    GenericVariableCollectionIndexBase genericIndex
    Returns
    Type Description
    System.Boolean

    CreateCopyFromClonedModel(Model)

    After calling DeepClone() on the originalModel, you can use this method to get a correctly typed clone of this GenericVariableCollectionBase<TGenericCollection>, that can be used to access/modify the cloned variables in the clonedModel.

    Declaration
    public TGenericCollection CreateCopyFromClonedModel(Model clonedModel)
    Parameters
    Type Name Description
    Model clonedModel

    The cloned version of the original model that you created by calling DeepClone().

    Important: "This" variable collection needs to be associated to the "original model", otherwise the created copy will not work as intended.

    Returns
    Type Description
    TGenericCollection

    A generically typed variable collection that manages the cloned versions of variables that belong to "this" collection.

    CreateTypedInstance(VariableCollection)

    Method instanciates a new TGenericCollection, that uses the given internalCollection as its _internalVariableCollection.

    Declaration
    protected abstract TGenericCollection CreateTypedInstance(VariableCollection internalCollection)
    Parameters
    Type Name Description
    VariableCollection internalCollection

    The internal variable collection to use.

    Returns
    Type Description
    TGenericCollection

    A new instance of TGenericCollection, working on internalCollection.

    GetLongNameFromIndex(Object[])

    If the model uses short names, the long name is generated from the given index. Else, the name of the variable for the given index is returned.

    Declaration
    public string GetLongNameFromIndex(object[] index)
    Parameters
    Type Name Description
    System.Object[] index

    The index. If the variable for the index has not been created yet, an exception will be thrown.

    Returns
    Type Description
    System.String

    The System.String.

    Exceptions
    Type Condition
    System.ArgumentException

    Thrown, if the index is not yet known.

    GetVariableFromGenericIndex(GenericVariableCollectionIndexBase)

    Declaration
    protected Variable GetVariableFromGenericIndex(GenericVariableCollectionIndexBase genericIndex)
    Parameters
    Type Name Description
    GenericVariableCollectionIndexBase genericIndex
    Returns
    Type Description
    Variable

    SetVariableValues(IDictionary<String, Double>)

    Sets the value property for each variable in this to the corresponding value in the values. The matching happens by string comparison of the name of the variable.

    Declaration
    public 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)

    Implements
    IVariableCollection.SetVariableValues(IDictionary<String, Double>)

    Explicit Interface Implementations

    IVariableCollection.IsVariableForIndexInstanciated(Object[])

    Checks if a variable was created for the given index.

    Declaration
    bool IVariableCollection.IsVariableForIndexInstanciated(params object[] index)
    Parameters
    Type Name Description
    System.Object[] index

    The index.

    Returns
    Type Description
    System.Boolean

    True, if a variable was created.

    Implements
    IVariableCollection.IsVariableForIndexInstanciated(Object[])

    Extension Methods

    ReflectionHelper.GetFieldValue(Object, String)
    ReflectionHelper.SetFieldValue(Object, String, Object)
    ExtensionMethods.Clone<T>(T)
    ExtensionMethods.ThrowIfArgumentIsNull<T>(T, String)
    Back to top Copyright © OPTANO GmbH generated with DocFX
    Privacy Policy | Impressum – Legal Notice