Class CSTNPSUEdgePluggable

All Implemented Interfaces:
BasicCSTNUEdge, Component, CSTNEdge, CSTNPSUEdge, Edge, Serializable, Comparable<Object>

public class CSTNPSUEdgePluggable extends BasicCSTNUEdgePluggable implements CSTNPSUEdge
An implementation of CSTNPSUEdge.
This edge differs from the CSTNU edge because it also admits that lower-case values are propagated and that it is possible to have lower-case values with conjoined lower-case labels.
Version:
$Rev: 852 $
Author:
posenato
See Also:
  • Field Details

    • consideredLowerCaseValue

      it.unimi.dsi.fastutil.objects.Object2IntMap<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<Label,ALabel>> consideredLowerCaseValue
      The CSTNU controllability check algorithm needs to know if a labeled value has been already considered in the past in order to avoid to add it a second time.
    • lowerCaseValues

      LabeledALabelIntTreeMap lowerCaseValues
      Morris Lower case value augmented by a propositional label.
      The name of node has to be equal to the original name. No case modifications are necessary!
  • Constructor Details

    • CSTNPSUEdgePluggable

      CSTNPSUEdgePluggable()
      Default constructor. Empty edge.
    • CSTNPSUEdgePluggable

      CSTNPSUEdgePluggable(String n)
      Parameters:
      n - name of edge
    • CSTNPSUEdgePluggable

      CSTNPSUEdgePluggable(Edge e)
      Constructor to clone the component.
      Parameters:
      e - the edge to clone.
  • Method Details

    • clear

      public void clear()
      Description copied from class: CSTNEdgePluggable
      Clear all component but name.
      Clear (remove) all labeled values associated to this edge.
      Specified by:
      clear in interface Component
      Overrides:
      clear in class BasicCSTNUEdgePluggable
    • hasSameValues

      public final boolean hasSameValues(Edge e)
      Specified by:
      hasSameValues in interface Edge
      Overrides:
      hasSameValues in class BasicCSTNUEdgePluggable
      Parameters:
      e - the other edge
      Returns:
      true if it has the same values.
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Edge
      Overrides:
      isEmpty in class BasicCSTNUEdgePluggable
      Returns:
      true if it does not contain any values
    • mergeLabeledValue

      public boolean mergeLabeledValue(Label l, int i)
      Description copied from class: CSTNEdgePluggable
      Merges the labeled value i to the set of labeled values of this edge.

      Merges the labeled value i to the set of labeled values of this edge.

      Specified by:
      mergeLabeledValue in interface CSTNEdge
      Overrides:
      mergeLabeledValue in class BasicCSTNUEdgePluggable
      Parameters:
      l - a Label object.
      i - the new weight.
      Returns:
      true if the operation was successful, false otherwise.
    • takeIn

      public void takeIn(Edge e)
      Description copied from interface: Edge
      A copy by reference of internal structure of edge e.
      Specified by:
      takeIn in interface Edge
      Overrides:
      takeIn in class BasicCSTNUEdgePluggable
      Parameters:
      e - edge to clone. If null, it does nothing.
    • setLowerCaseValueAsConsidered

      void setLowerCaseValueAsConsidered(Label l, ALabel n, int i)
      Set the triple as already considered in order to avoid to consider it again in the future.
      Parameters:
      l - label
      n - name of node as a-label
      i - edge weight
    • clearLowerCaseValue

      public void clearLowerCaseValue()
      Description copied from interface: BasicCSTNUEdge
      Clears the labeled lower case values. For CSTNU there is always only one value, but for some extensions can be more.
      Specified by:
      clearLowerCaseValue in interface BasicCSTNUEdge
    • lowerCaseValueAsString

      public String lowerCaseValueAsString()
      Specified by:
      lowerCaseValueAsString in interface BasicCSTNUEdge
      Returns:
      the representation of the lower-case value(s) of the edge.
    • lowerCaseValueSize

      public final int lowerCaseValueSize()
      Specified by:
      lowerCaseValueSize in interface BasicCSTNUEdge
      Returns:
      the number of lower-case value(s) of the edge.
    • clearLowerCaseValues

      public void clearLowerCaseValues()
      Description copied from interface: CSTNPSUEdge
      Clears the labeled lower case values.
      Specified by:
      clearLowerCaseValues in interface CSTNPSUEdge
    • putLowerCaseValue

      public final void putLowerCaseValue(@Nonnull Label l, @Nonnull ALabel nodeName, int i)
      Description copied from interface: BasicCSTNUEdge
      Set or add a lower label constraint with delay i for the node n with label l.

      If a value having lower-case nodeName and label l for node n is already present, it is overwritten.

      Specified by:
      putLowerCaseValue in interface BasicCSTNUEdge
      Parameters:
      l - the label
      nodeName - the node name. It cannot be null.
      i - the new value
    • getAllLowerCaseAndLabeledValues

      public it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<ALabel,it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>>> getAllLowerCaseAndLabeledValues()
      Description copied from interface: CSTNPSUEdge
      Don't use this set for a scanning that requires to modify the internal map because otherwise this set becomes not valid at first modification.
      Specified by:
      getAllLowerCaseAndLabeledValues in interface CSTNPSUEdge
      Returns:
      the set of all labeled values and all labeled lower-case ones. The labeled values have ALabel empty.
    • getLabelsOfLowerCaseValues

      public it.unimi.dsi.fastutil.objects.ObjectSet<Label> getLabelsOfLowerCaseValues(@Nonnull ALabel aLabel)
      Specified by:
      getLabelsOfLowerCaseValues in interface CSTNPSUEdge
      Parameters:
      aLabel - the lower-case label
      Returns:
      the set of all labels associated to lower-case label aLabel.
    • getLabelsOfLowerCaseValues

      public it.unimi.dsi.fastutil.objects.ObjectSet<Label> getLabelsOfLowerCaseValues()
      Specified by:
      getLabelsOfLowerCaseValues in interface CSTNPSUEdge
      Returns:
      the set of all labels associated to all lower-case labeled value;
    • getMinLowerCaseValue

      @Nullable public it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<Label,it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<ALabel>> getMinLowerCaseValue()
      Specified by:
      getMinLowerCaseValue in interface CSTNPSUEdge
      Returns:
      a copy of the minimal value (with the ALabel) among all upper-case labeled values if there are some of them, null otherwise.
    • getLowerCaseLabels

      public it.unimi.dsi.fastutil.objects.ObjectSet<ALabel> getLowerCaseLabels()
      Specified by:
      getLowerCaseLabels in interface CSTNPSUEdge
      Returns:
      the set of all lower-case labels.
    • getLowerCaseValue

      public int getLowerCaseValue(Label l, ALabel name1)
      Specified by:
      getLowerCaseValue in interface CSTNPSUEdge
      Parameters:
      l - a Label object.
      name1 - a ALabel node name.
      Returns:
      the labeled lower-Case value. Constants.INT_NULL if the value does not exist.
    • getLowerCaseValues

      public it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<ALabel,it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>>> getLowerCaseValues()
      Description copied from interface: CSTNPSUEdge
      Don't use this set for a scanning that requires to modify the internal map because otherwise this set becomes not valid at first modification.
      Specified by:
      getLowerCaseValues in interface CSTNPSUEdge
      Returns:
      the set of all labeled lower-case values.
    • getLowerCaseValues

      @Nonnull public it.unimi.dsi.fastutil.objects.ObjectSet<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>> getLowerCaseValues(@Nonnull ALabel lowerCaseLabel)
      Specified by:
      getLowerCaseValues in interface CSTNPSUEdge
      Parameters:
      lowerCaseLabel - a non-null lower-case label.
      Returns:
      a view of the lower-case values associated lowerCaseLabel if there are some of them, empty set otherwise.
    • mergeLowerCaseValue

      public final boolean mergeLowerCaseValue(@Nonnull Label l, @Nonnull ALabel nodeName, int i)
      Description copied from interface: CSTNPSUEdge
      Merge a lower label constraint with value i for the node name n with label l.
      Specified by:
      mergeLowerCaseValue in interface CSTNPSUEdge
      Parameters:
      l - It cannot be null or empty.
      nodeName - the node name. It cannot be null. It must be the unmodified name of the node.
      i - It cannot be nullInt.
      Returns:
      true if the merge has been successful.
    • removeLowerCaseValue

      public final void removeLowerCaseValue(Label l, ALabel n)
      Specified by:
      removeLowerCaseValue in interface CSTNPSUEdge
      Parameters:
      l - a Label object.
      n - a ALabel node name
    • setLowerCaseValues

      public void setLowerCaseValues(LabeledALabelIntTreeMap lowerCaseValue1)
      Specified by:
      setLowerCaseValues in interface CSTNPSUEdge
      Parameters:
      lowerCaseValue1 - the labeled lower case value to use for initializing the current one.
    • isCSTNPSUEdge

      public boolean isCSTNPSUEdge()
      Description copied from interface: Edge
      This method is inappropriate here, but it helps to speed up the code.
      Specified by:
      isCSTNPSUEdge in interface Edge
      Overrides:
      isCSTNPSUEdge in class AbstractEdge
      Returns:
      true if the edge is CSTNPSU edge
    • newInstance

      public CSTNPSUEdgePluggable newInstance()
      Description copied from interface: Edge
      Factory
      Specified by:
      newInstance in interface Edge
      Overrides:
      newInstance in class CSTNEdgePluggable
      Returns:
      an object of type Edge.
    • newInstance

      public CSTNPSUEdgePluggable newInstance(Edge edge)
      Description copied from interface: Edge
      Any super-interfaces/implementing classes should assure that such method has edge as argument!
      Specified by:
      newInstance in interface Edge
      Overrides:
      newInstance in class CSTNEdgePluggable
      Parameters:
      edge - an object to clone.
      Returns:
      an object of type Edge.
    • newInstance

      public CSTNPSUEdgePluggable newInstance(String name1)
      Description copied from interface: Edge
      Factory
      Specified by:
      newInstance in interface Edge
      Overrides:
      newInstance in class CSTNEdgePluggable
      Parameters:
      name1 - of the edge
      Returns:
      an object of type Edge.