Class CSTNPSUEdgePluggable

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

public class CSTNPSUEdgePluggable extends BasicCSTNUEdgePluggable implements CSTNPSUEdge
An implementation of CSTNUEdge where the labeled value set can be plugged during the creation.
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.
    • lowerCaseValue

      LabeledALabelIntTreeMap lowerCaseValue
      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()
    • 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
    • clearLowerCaseValues

      public void clearLowerCaseValues()
      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:
      clearLowerCaseValues in interface BasicCSTNUEdge
    • getAllLowerCaseAndLabeledValuesMaps

      public final LabeledALabelIntTreeMap getAllLowerCaseAndLabeledValuesMaps()
      Specified by:
      getAllLowerCaseAndLabeledValuesMaps in interface CSTNPSUEdge
      Returns:
      the set of maps of labeled values and labeled lower-case ones. The maps of labeled values has ALabel empty.
    • getLowerCaseValue

      public LabeledLowerCaseValue getLowerCaseValue()
      Specified by:
      getLowerCaseValue in interface BasicCSTNUEdge
      Returns:
      the labeled lower-case value object characteristics of a contingent/guarded link. Use LabeledLowerCaseValue.isEmpty() to check if it contains or not a significant value. If there is no lower-case value or there are more lower-case values (in extensions of CSTNUs), it returns an empty LabeledLowerCaseValue object. In case that there is more lower-case values (extensions of CSTNU), consider BasicCSTNUEdge.getMinLowerCaseValue().
    • setLowerCaseValue

      public void setLowerCaseValue(LabeledALabelIntTreeMap lowerCaseValue1)
      Specified by:
      setLowerCaseValue in interface CSTNPSUEdge
      Parameters:
      lowerCaseValue1 - the labeled lower case value to use for initializing the current one.
    • 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 object. Use LabeledLowerCaseValue.isEmpty() to check if it contains or not a significant value.
    • getLowerCaseValueMap

      public LabeledALabelIntTreeMap getLowerCaseValueMap()
      Specified by:
      getLowerCaseValueMap in interface CSTNPSUEdge
      Returns:
      the Lower-Case labeled Value Map.
    • 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 BasicCSTNUEdge
      Returns:
      the minimal value (with the ALabel) among all lower-case labeled values if there are some of them, null otherwise.
    • 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.
    • 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
    • isEmpty

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

      public final int lowerCaseValueSize()
      Specified by:
      lowerCaseValueSize in interface BasicCSTNUEdge
      Returns:
      the number of Lower-Case Labels of the edge.
    • lowerCaseValuesAsString

      public String lowerCaseValuesAsString()
      Specified by:
      lowerCaseValuesAsString in interface BasicCSTNUEdge
      Returns:
      the representation of all Lower-Case Labels of the edge.
    • 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.
    • mergeLowerCaseValue

      public final boolean mergeLowerCaseValue(Label l, ALabel nodeName, int i)
      Description copied from interface: BasicCSTNUEdge
      Merge a lower label constraint with value i for the node name n with label l.
      Specified by:
      mergeLowerCaseValue in interface BasicCSTNUEdge
      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.
    • 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.
    • putLowerCaseValue

      public final boolean putLowerCaseValue(Label l, ALabel nodeName, int i)
      Description copied from interface: BasicCSTNUEdge
      Put a lower label constraint with value i for the node name n with label l.
      Putting does not make any label optimization.
      Specified by:
      putLowerCaseValue in interface BasicCSTNUEdge
      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 int removeLowerCaseValue(Label l, ALabel n)
      Specified by:
      removeLowerCaseValue in interface CSTNPSUEdge
      Parameters:
      l - a Label object.
      n - a ALabel node name
      Returns:
      the value of the removed labeled value
    • 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

      int 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
      Returns:
      the old value associated to (l,n), or the Constants.INT_NULL if no value was present.