Class RescheduleValueChangeVisitor

java.lang.Object
net.ssehub.easy.varModel.model.values.ValueVisitorAdapter
net.ssehub.easy.reasoning.sseReasoner.RescheduleValueChangeVisitor
All Implemented Interfaces:
net.ssehub.easy.varModel.cstEvaluation.IValueChangeListener, net.ssehub.easy.varModel.model.values.IValueVisitor

class RescheduleValueChangeVisitor extends net.ssehub.easy.varModel.model.values.ValueVisitorAdapter implements net.ssehub.easy.varModel.cstEvaluation.IValueChangeListener
Reschedules value changes. Uses the provided resolver instance to perform further transformations and to register new constraints with the constraint base.
Author:
Holger Eichelberger
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.ssehub.easy.varModel.cstEvaluation.IValueChangeListener

    net.ssehub.easy.varModel.cstEvaluation.IValueChangeListener.ChangeKind
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
     
    private static final net.ssehub.easy.basics.logger.EASyLoggerFactory.EASyLogger
     
    private net.ssehub.easy.varModel.model.values.Value
     
    private Resolver
     
    private net.ssehub.easy.varModel.confModel.IDecisionVariable
     
    private net.ssehub.easy.varModel.confModel.IDecisionVariable
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a rescheduling value change visitor for a certain resolver instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    private boolean
    isValueTypeChange(net.ssehub.easy.varModel.confModel.IDecisionVariable variable, net.ssehub.easy.varModel.model.values.Value newValue, net.ssehub.easy.varModel.model.values.Value oldValue)
    Returns whether a value change from oldValue to newValue on variable is a value type change.
    void
    notifyChanged(net.ssehub.easy.varModel.confModel.IDecisionVariable variable, net.ssehub.easy.varModel.model.values.Value oldValue, net.ssehub.easy.varModel.confModel.IAssignmentState oldState, net.ssehub.easy.varModel.cstEvaluation.IValueChangeListener.ChangeKind kind)
     
    void
    notifyUnresolved(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
     
    private void
    rescheduleConstraintsForChilds(net.ssehub.easy.varModel.confModel.IDecisionVariable variable, boolean decl)
    Determines the constraints needed for variable and its (transitive) child slots.
    private void
    rescheduleConstraintsForParent(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
    Determines the constraints needed for the parents of variable.
    (package private) void
    rescheduleValueChange(net.ssehub.easy.varModel.confModel.IDecisionVariable varParent, net.ssehub.easy.varModel.confModel.IDecisionVariable variable, net.ssehub.easy.varModel.model.values.Value oldValue, boolean clear)
    Re-schedules a changed constraint value but only if rescheduling is needed.
    void
    visitCompoundValue(net.ssehub.easy.varModel.model.values.CompoundValue newValue)
     
    void
    visitConstraintValue(net.ssehub.easy.varModel.model.values.ConstraintValue value)
     
    void
    visitContainerValue(net.ssehub.easy.varModel.model.values.ContainerValue newValue)
     

    Methods inherited from class net.ssehub.easy.varModel.model.values.ValueVisitorAdapter

    visitBooleanValue, visitEnumValue, visitIntValue, visitMetaTypeValue, visitNullValue, visitRealValue, visitReferenceValue, visitStringValue, visitVersionValue

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • LOGGER

      private static final net.ssehub.easy.basics.logger.EASyLoggerFactory.EASyLogger LOGGER
    • resolver

      private Resolver resolver
    • clear

      private boolean clear
    • oldValue

      private net.ssehub.easy.varModel.model.values.Value oldValue
    • variable

      private net.ssehub.easy.varModel.confModel.IDecisionVariable variable
    • varParent

      private net.ssehub.easy.varModel.confModel.IDecisionVariable varParent
  • Constructor Details

    • RescheduleValueChangeVisitor

      public RescheduleValueChangeVisitor(Resolver resolver)
      Creates a rescheduling value change visitor for a certain resolver instance.
      Parameters:
      resolver - the resolver instance
  • Method Details

    • visitConstraintValue

      public void visitConstraintValue(net.ssehub.easy.varModel.model.values.ConstraintValue value)
      Specified by:
      visitConstraintValue in interface net.ssehub.easy.varModel.model.values.IValueVisitor
      Overrides:
      visitConstraintValue in class net.ssehub.easy.varModel.model.values.ValueVisitorAdapter
    • visitCompoundValue

      public void visitCompoundValue(net.ssehub.easy.varModel.model.values.CompoundValue newValue)
      Specified by:
      visitCompoundValue in interface net.ssehub.easy.varModel.model.values.IValueVisitor
      Overrides:
      visitCompoundValue in class net.ssehub.easy.varModel.model.values.ValueVisitorAdapter
    • visitContainerValue

      public void visitContainerValue(net.ssehub.easy.varModel.model.values.ContainerValue newValue)
      Specified by:
      visitContainerValue in interface net.ssehub.easy.varModel.model.values.IValueVisitor
      Overrides:
      visitContainerValue in class net.ssehub.easy.varModel.model.values.ValueVisitorAdapter
    • rescheduleValueChange

      void rescheduleValueChange(net.ssehub.easy.varModel.confModel.IDecisionVariable varParent, net.ssehub.easy.varModel.confModel.IDecisionVariable variable, net.ssehub.easy.varModel.model.values.Value oldValue, boolean clear)
      Re-schedules a changed constraint value but only if rescheduling is needed.
      Parameters:
      varParent - the parent variable holding variable, if not nested use variable
      variable - the variable for which the value changed
      oldValue - the old value
      clear - whether constraints for holder shall be cleared
    • notifyChanged

      public void notifyChanged(net.ssehub.easy.varModel.confModel.IDecisionVariable variable, net.ssehub.easy.varModel.model.values.Value oldValue, net.ssehub.easy.varModel.confModel.IAssignmentState oldState, net.ssehub.easy.varModel.cstEvaluation.IValueChangeListener.ChangeKind kind)
      Specified by:
      notifyChanged in interface net.ssehub.easy.varModel.cstEvaluation.IValueChangeListener
    • notifyUnresolved

      public void notifyUnresolved(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
      Specified by:
      notifyUnresolved in interface net.ssehub.easy.varModel.cstEvaluation.IValueChangeListener
    • isValueTypeChange

      private boolean isValueTypeChange(net.ssehub.easy.varModel.confModel.IDecisionVariable variable, net.ssehub.easy.varModel.model.values.Value newValue, net.ssehub.easy.varModel.model.values.Value oldValue)
      Returns whether a value change from oldValue to newValue on variable is a value type change.
      Parameters:
      variable - the variable
      newValue - the new value (in variable
      oldValue - the old value
      Returns:
      true for type change, false else
    • rescheduleConstraintsForParent

      private void rescheduleConstraintsForParent(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
      Determines the constraints needed for the parents of variable.
      Parameters:
      variable - the variable to analyze
    • rescheduleConstraintsForChilds

      private void rescheduleConstraintsForChilds(net.ssehub.easy.varModel.confModel.IDecisionVariable variable, boolean decl)
      Determines the constraints needed for variable and its (transitive) child slots.
      Parameters:
      variable - the variable to analyze
      decl - reschedule on the declaration of variable or on variable itself