Class CSTNPSUEdgePluggable
java.lang.Object
it.univr.di.cstnu.graph.AbstractComponent
it.univr.di.cstnu.graph.AbstractEdge
it.univr.di.cstnu.graph.CSTNEdgePluggable
it.univr.di.cstnu.graph.BasicCSTNUEdgePluggable
it.univr.di.cstnu.graph.CSTNPSUEdgePluggable
- All Implemented Interfaces:
BasicCSTNUEdge
,Component
,CSTNEdge
,CSTNPSUEdge
,Edge
,Serializable
,Comparable<Object>
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.
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class it.univr.di.cstnu.graph.BasicCSTNUEdgePluggable
BasicCSTNUEdgePluggable.InternalEntry
Nested classes/interfaces inherited from interface it.univr.di.cstnu.graph.Edge
Edge.ConstraintType
-
Field Summary
Modifier and TypeFieldDescription(package private) it.unimi.dsi.fastutil.objects.Object2IntMap
<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<Label, ALabel>> 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.(package private) LabeledALabelIntTreeMap
Morris Lower case value augmented by a propositional label.
The name of node has to be equal to the original name.Fields inherited from class it.univr.di.cstnu.graph.BasicCSTNUEdgePluggable
consideredUpperCaseValue, upperCaseValue
Fields inherited from class it.univr.di.cstnu.graph.CSTNEdgePluggable
consideredLabeledValue, DEFAULT_LABELED_INT_MAP_CLASS, labeledValue, labeledValueMapImpl, LOG
Fields inherited from class it.univr.di.cstnu.graph.AbstractEdge
constraintType
Fields inherited from class it.univr.di.cstnu.graph.AbstractComponent
name, pcs
-
Constructor Summary
ConstructorDescriptionDefault constructor.Constructor to clone the component. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all component but name.void
Clears the labeled lower case values.void
Clears the labeled lower case values.it.unimi.dsi.fastutil.objects.ObjectSet
<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<ALabel, it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>>> 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.it.unimi.dsi.fastutil.objects.ObjectSet
<Label> it.unimi.dsi.fastutil.objects.ObjectSet
<Label> getLabelsOfLowerCaseValues
(ALabel aLabel) it.unimi.dsi.fastutil.objects.ObjectSet
<ALabel> int
getLowerCaseValue
(Label l, ALabel name1) it.unimi.dsi.fastutil.objects.ObjectSet
<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<ALabel, it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>>> 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.it.unimi.dsi.fastutil.objects.ObjectSet
<it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<Label>> getLowerCaseValues
(ALabel lowerCaseLabel) it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry
<Label, it.unimi.dsi.fastutil.objects.Object2IntMap.Entry<ALabel>> final boolean
boolean
This method is inappropriate here, but it helps to speed up the code.boolean
isEmpty()
final int
boolean
mergeLabeledValue
(Label l, int i) Merges the labeled value i to the set of labeled values of this edge.final boolean
mergeLowerCaseValue
(Label l, ALabel nodeName, int i) Merge a lower label constraint with valuei
for the node namen
with labell
.FactorynewInstance
(Edge edge) Any super-interfaces/implementing classes should assure that such method has edge as argument!newInstance
(String name1) Factoryfinal void
putLowerCaseValue
(Label l, ALabel nodeName, int i) Set or add a lower label constraint with delay i for the node n with label l.final void
removeLowerCaseValue
(Label l, ALabel n) (package private) 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.void
setLowerCaseValues
(LabeledALabelIntTreeMap lowerCaseValue1) void
A copy by reference of internal structure of edge e.Methods inherited from class it.univr.di.cstnu.graph.BasicCSTNUEdgePluggable
clearUpperCaseValues, getAllUpperCaseAndLabeledValues, getLabelsOfUpperCaseValues, getLabelsOfUpperCaseValues, getMinUpperCaseValue, getMinUpperCaseValue, getUpperCaseLabels, getUpperCaseValue, getUpperCaseValues, getUpperCaseValues, mergeUpperCaseValue, pairAsString, putLabeledValue, putUpperCaseValue, removeUpperCaseValue, setUpperCaseValueAsConsidered, setUpperCaseValueMap, size, toString, upperCaseValueAsString, upperCaseValuesAsString, upperCaseValueSize
Methods inherited from class it.univr.di.cstnu.graph.CSTNEdgePluggable
getLabeledIntMapImplClass, getLabeledValues, getLabelsOfLabeledValues, getMinLabeledValue, getMinValue, getMinValueSubsumedBy, getValue, isCSTNEdge, labeledValuesAsString, mergeLabeledValue, mergeLabeledValues, removeLabeledValue, setLabeledValueMap
Methods inherited from class it.univr.di.cstnu.graph.AbstractEdge
getConstraintType, isCSTNUEdge, isOSTNUEdge, isSTNEdge, isSTNUEdge, setConstraintType, setName
Methods inherited from class it.univr.di.cstnu.graph.AbstractComponent
addObserver, compareTo, equals, equalsByName, getName, hashCode, inNegativeCycle, removeObserver, setInNegativeCycle, takeIn
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface it.univr.di.cstnu.graph.BasicCSTNUEdge
clearUpperCaseValues, getAllUpperCaseAndLabeledValues, getLabelsOfUpperCaseValues, getLabelsOfUpperCaseValues, getMinUpperCaseValue, getMinUpperCaseValue, getUpperCaseLabels, getUpperCaseValue, getUpperCaseValues, getUpperCaseValues, mergeUpperCaseValue, putUpperCaseValue, removeUpperCaseValue, setUpperCaseValueMap, size, upperCaseValuesAsString, upperCaseValueSize
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface it.univr.di.cstnu.graph.Component
equals, equalsByName, getName, hashCode, inNegativeCycle, setInNegativeCycle, setName, toString
Methods inherited from interface it.univr.di.cstnu.graph.CSTNEdge
getLabeledIntMapImplClass, getLabeledValues, getLabelsOfLabeledValues, getMinLabeledValue, getMinValue, getMinValueSubsumedBy, getValue, labeledValuesAsString, mergeLabeledValue, mergeLabeledValues, putLabeledValue, removeLabeledValue, setLabeledValueMap
Methods inherited from interface it.univr.di.cstnu.graph.Edge
getConstraintType, isContingentEdge, isCSTNEdge, isCSTNUEdge, isOSTNUEdge, isRequirementEdge, isSTNEdge, isSTNUEdge, setConstraintType
-
Field Details
-
consideredLowerCaseValue
-
lowerCaseValues
LabeledALabelIntTreeMap lowerCaseValuesMorris 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
-
-
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 interfaceComponent
- Overrides:
clear
in classBasicCSTNUEdgePluggable
-
hasSameValues
- Specified by:
hasSameValues
in interfaceEdge
- Overrides:
hasSameValues
in classBasicCSTNUEdgePluggable
- Parameters:
e
- the other edge- Returns:
- true if it has the same values.
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceEdge
- Overrides:
isEmpty
in classBasicCSTNUEdgePluggable
- Returns:
- true if it does not contain any values
-
mergeLabeledValue
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 interfaceCSTNEdge
- Overrides:
mergeLabeledValue
in classBasicCSTNUEdgePluggable
- Parameters:
l
- aLabel
object.i
- the new weight.- Returns:
- true if the operation was successful, false otherwise.
-
takeIn
-
setLowerCaseValueAsConsidered
-
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 interfaceBasicCSTNUEdge
-
lowerCaseValueAsString
- Specified by:
lowerCaseValueAsString
in interfaceBasicCSTNUEdge
- Returns:
- the representation of the lower-case value(s) of the edge.
-
lowerCaseValueSize
public final int lowerCaseValueSize()- Specified by:
lowerCaseValueSize
in interfaceBasicCSTNUEdge
- 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 interfaceCSTNPSUEdge
-
putLowerCaseValue
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 interfaceBasicCSTNUEdge
- Parameters:
l
- the labelnodeName
- 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 interfaceCSTNPSUEdge
- 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 interfaceCSTNPSUEdge
- Parameters:
aLabel
- the lower-case label- Returns:
- the set of all labels associated to lower-case label aLabel.
-
getLabelsOfLowerCaseValues
- Specified by:
getLabelsOfLowerCaseValues
in interfaceCSTNPSUEdge
- 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 interfaceCSTNPSUEdge
- 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
- Specified by:
getLowerCaseLabels
in interfaceCSTNPSUEdge
- Returns:
- the set of all lower-case labels.
-
getLowerCaseValue
- Specified by:
getLowerCaseValue
in interfaceCSTNPSUEdge
- Parameters:
l
- aLabel
object.name1
- aALabel
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 interfaceCSTNPSUEdge
- 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 interfaceCSTNPSUEdge
- 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
Description copied from interface:CSTNPSUEdge
Merge a lower label constraint with valuei
for the node namen
with labell
.- Specified by:
mergeLowerCaseValue
in interfaceCSTNPSUEdge
- 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
- Specified by:
removeLowerCaseValue
in interfaceCSTNPSUEdge
- Parameters:
l
- aLabel
object.n
- aALabel
node name
-
setLowerCaseValues
- Specified by:
setLowerCaseValues
in interfaceCSTNPSUEdge
- 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 interfaceEdge
- Overrides:
isCSTNPSUEdge
in classAbstractEdge
- Returns:
- true if the edge is CSTNPSU edge
-
newInstance
Description copied from interface:Edge
Factory- Specified by:
newInstance
in interfaceEdge
- Overrides:
newInstance
in classCSTNEdgePluggable
- Returns:
- an object of type Edge.
-
newInstance
Description copied from interface:Edge
Any super-interfaces/implementing classes should assure that such method has edge as argument!- Specified by:
newInstance
in interfaceEdge
- Overrides:
newInstance
in classCSTNEdgePluggable
- Parameters:
edge
- an object to clone.- Returns:
- an object of type Edge.
-
newInstance
Description copied from interface:Edge
Factory- Specified by:
newInstance
in interfaceEdge
- Overrides:
newInstance
in classCSTNEdgePluggable
- Parameters:
name1
- of the edge- Returns:
- an object of type Edge.
-