Package it.univr.di.cstnu.graph
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<Component>
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: 993 $
- 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
FieldsModifier 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 already been considered in the past to avoid adding it a second time.(package private) LabeledALabelIntTreeMap
Morris Lower case value augmented by a propositional label.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
ConstructorsConstructorDescriptionDefault constructor.Constructor to clone the component. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all components but the name.void
Clears the labeled lowercase values.void
Clears the labeled lowercase 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 scanning that requires modifying the internal map; otherwise, this set will become invalid after the 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 scanning that requires modifying the internal map; otherwise, this set will become invalid after the 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 into 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 ensure that such a method has the edge as an 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 to avoid considering it again in the future.void
setLowerCaseValues
(LabeledALabelIntTreeMap lowerCaseValue1) void
A copy by reference of the 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
it.unimi.dsi.fastutil.objects.Object2IntMap<it.unimi.dsi.fastutil.objects.Object2ObjectMap.Entry<Label,ALabel>> consideredLowerCaseValueThe CSTNU controllability check algorithm needs to know if a labeled value has already been considered in the past to avoid adding it a second time. -
lowerCaseValues
LabeledALabelIntTreeMap lowerCaseValuesMorris Lower case value augmented by a propositional label.The name of the node has to be equal to the original name. No case modifications are necessary!
-
-
Constructor Details
-
Method Details
-
clear
public void clear()Description copied from class:CSTNEdgePluggable
Clear all components but the name.Clear (remove) all labeled values associated with this edge.
- Specified by:
clear
in interfaceComponent
- Overrides:
clear
in classBasicCSTNUEdgePluggable
-
clearLowerCaseValue
public void clearLowerCaseValue()Description copied from interface:BasicCSTNUEdge
Clears the labeled lowercase values. For CSTNU, there is always only one value, but for some extensions, it can be more.- Specified by:
clearLowerCaseValue
in interfaceBasicCSTNUEdge
-
clearLowerCaseValues
public void clearLowerCaseValues()Description copied from interface:CSTNPSUEdge
Clears the labeled lowercase values.- Specified by:
clearLowerCaseValues
in interfaceCSTNPSUEdge
-
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 scanning that requires modifying the internal map; otherwise, this set will become invalid after the first modification.- Specified by:
getAllLowerCaseAndLabeledValues
in interfaceCSTNPSUEdge
- Returns:
- the set of all labeled values and all labeled lower-case ones. The labeled values have an empty ALabel.
-
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 with lower-case label aLabel.
-
getLabelsOfLowerCaseValues
- Specified by:
getLabelsOfLowerCaseValues
in interfaceCSTNPSUEdge
- Returns:
- the set of all labels associated with all lower-case labeled values;
-
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 scanning that requires modifying the internal map; otherwise, this set will become invalid after the first modification.- Specified by:
getLowerCaseValues
in interfaceCSTNPSUEdge
- Returns:
- the set of all labeled lower-case values.
-
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.
-
getLowerCaseValues
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 with lowerCaseLabel if there are some of them, an empty set otherwise.
-
hasSameValues
- Specified by:
hasSameValues
in interfaceEdge
- Overrides:
hasSameValues
in classBasicCSTNUEdgePluggable
- 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 interfaceEdge
- Overrides:
isCSTNPSUEdge
in classAbstractEdge
- Returns:
- true if the edge is a CSTNPSU edge
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceEdge
- Overrides:
isEmpty
in classBasicCSTNUEdgePluggable
- Returns:
- true if it does not contain any values
-
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.
-
mergeLabeledValue
Description copied from class:CSTNEdgePluggable
Merges the labeled value i into the set of labeled values of this edge.Merges the labeled value i into 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.
-
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 null.- Returns:
- true if the merge has been successful.
-
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 with a 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
-
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 ensure that such a method has the edge as an 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.
-
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.
-
takeIn
Description copied from interface:Edge
A copy by reference of the internal structure of edge e.- Specified by:
takeIn
in interfaceEdge
- Overrides:
takeIn
in classBasicCSTNUEdgePluggable
- Parameters:
e
- edge to clone. If null, it does nothing.
-
setLowerCaseValueAsConsidered
Set the triple as already considered to avoid considering it again in the future.- Parameters:
l
- labeln
- name of node as a-labeli
- edge weight
-