Interface IDecisionVariableContainer

All Superinterfaces:
IContainableElementsSorter, IModelElement
All Known Implementing Classes:
AttributeAssignment, BasicDecisionVariableContainer, Compound, FullDecisionVariableContainer

public interface IDecisionVariableContainer extends IModelElement, IContainableElementsSorter
Describes a container for decision variables.
Author:
Holger Eichelberger
  • Method Details

    • add

      void add(AttributeAssignment assignment)
      Adds a nested assignment.
      Parameters:
      assignment - the assignment which should be added
    • add

      void add(EvaluationBlock eval)
      adds a nested evaluation block.
      Parameters:
      eval - the eval block
    • getAssignmentCount

      int getAssignmentCount()
      Returns the number of assignments.
      Returns:
      the number of assignments
    • getAssignment

      AttributeAssignment getAssignment(int index)
      Returns the assignment specified by index.
      Parameters:
      index - a 0-based index specifying the element to be returned
      Returns:
      the assignment
      Throws:
      IndexOutOfBoundsException - if index<0 || index>=getAssignmentCount()
    • getModelElement

      ContainableModelElement getModelElement(int index)
      Returns a contained model element specified by index. Please note that this method returns all contained model elements, i.e., decision variables and constraints and is intended to restore the input sequence correctly.
      Parameters:
      index - a 0-based index specifying the operation to be returned
      Returns:
      the contained element
      Throws:
      IndexOutOfBoundsException - if index<0 || index>=getModelElementCount()
    • getModelElementCount

      int getModelElementCount()
      Returns the number of contained elements. Please note that this method refers to all contained model elements, i.e., decision variables and constraints and is intended to restore the input sequence correctly.
      Returns:
      the number of contained elements
    • getElement

      Returns the element specified by name.
      Parameters:
      name - the name of the element
      Returns:
      the element, null if none was found
    • contains

      boolean contains(DecisionVariableDeclaration var)
      Returns whether this element contains var.
      Parameters:
      var - the variable declaration to search for
      Returns:
      true if found, false else
    • add

      void add(Comment comment)
      Adds a comment to the list of contained elements.
      Parameters:
      comment - the comment to be added
    • getElementCount

      int getElementCount()
      Returns the number of elements.
      Returns:
      the number of elements
    • getElement

      DecisionVariableDeclaration getElement(int index)
      Returns the element specified by index.
      Parameters:
      index - a 0-based index specifying the element to be returned
      Returns:
      the element
      Throws:
      IndexOutOfBoundsException - if index<0 || index>=getElementCount()
    • add

      boolean add(DecisionVariableDeclaration elem)
      Method to add an object to the elements list of the project.
      Parameters:
      elem - which should be added
      Returns:
      true if the addition was successful, false else due to duplicated variable declaration
    • getConstraintsCount

      int getConstraintsCount()
      Returns the number of contained constraints.
      Returns:
      the number of constraints
    • getConstraint

      Constraint getConstraint(int index)
      Returns the specified contained constraint.
      Parameters:
      index - the index of the constraint to be returned
      Returns:
      the specified constraint
      Throws:
      IndexOutOfBoundsException - if index < 0 || index >= getConstraintsCount()
    • addConstraint

      void addConstraint(Constraint constraint, boolean internal)
      Adds a constraint.
      Parameters:
      constraint - the constraint to be added
      internal - whether the constraint is internally created while building up the model (ignored)
    • getRealizingCount

      int getRealizingCount()
      Returns the number of realizing constraints. Please note that these constraints are derived and not originally specified in the input IVML model.
      Returns:
      the number of constraints
    • getRealizing

      Constraint getRealizing(int index)
      Returns the specified realizing constraint. Please note that these constraints are derived and not originally specified in the input IVML model.
      Parameters:
      index - the index of the constraint to be returned
      Returns:
      the specified constraint
      Throws:
      IndexOutOfBoundsException - if index < 0 || index >= getRealizingCount()
    • getDeclarationCount

      int getDeclarationCount()
      Returns the number of all nested DecisionVariableDeclarations including nested DecisionVariableDeclarations of AttributeAssignments.
      Returns:
      The number of all nested DecisionVariableDeclarations. This will be greater or equal to 0.
    • getDeclaration

      DecisionVariableDeclaration getDeclaration(int index)
      Returns the specified DecisionVariableDeclaration.
      Parameters:
      index - the index of the DecisionVariableDeclaration to be returned
      Returns:
      the specified DecisionVariableDeclaration
      Throws:
      IndexOutOfBoundsException - if index < 0 || index >= getDeclarationCount()
    • containsByName

      boolean containsByName(String name)
      Returns whether this project contains an element and its name.
      Parameters:
      name - the name to search for
      Returns:
      true if this project contains the specified element, false else
    • forceUpdate

      void forceUpdate()
      Forces the IDecisionVariableContainer to update cached lists of nested DecisionVariableDeclarations. This is only necessary if multiple IDecisionVariableContainer are nested into each other and only during incremental build up if an inner element is updated while already added to the outer element.