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: 995 $
- Author:
- posenato
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class it.univr.di.cstnu.graph.BasicCSTNUEdgePluggable
BasicCSTNUEdgePluggable.InternalEntryNested 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) LabeledALabelIntTreeMapMorris Lower case value augmented by a propositional label.Fields inherited from class it.univr.di.cstnu.graph.BasicCSTNUEdgePluggable
consideredUpperCaseValue, upperCaseValueFields inherited from class it.univr.di.cstnu.graph.CSTNEdgePluggable
consideredLabeledValue, DEFAULT_LABELED_INT_MAP_CLASS, labeledValue, labeledValueMapImpl, LOGFields inherited from class it.univr.di.cstnu.graph.AbstractEdge
constraintTypeFields inherited from class it.univr.di.cstnu.graph.AbstractComponent
name, pcs -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Constructor to clone the component. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all components but the name.voidClears the labeled lowercase values.voidClears 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> intgetLowerCaseValue(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 booleanbooleanThis method is inappropriate here, but it helps to speed up the code.booleanisEmpty()final intbooleanmergeLabeledValue(Label l, int i) Merges the labeled value i into the set of labeled values of this edge.final booleanmergeLowerCaseValue(Label l, ALabel nodeName, int i) Merge a lower label constraint with valueifor the node namenwith 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 voidputLowerCaseValue(Label l, ALabel nodeName, int i) Set or add a lower label constraint with delay i for the node n with label l.final voidremoveLowerCaseValue(Label l, ALabel n) (package private) voidsetLowerCaseValueAsConsidered(Label l, ALabel n, int i) Set the triple as already considered to avoid considering it again in the future.voidsetLowerCaseValues(LabeledALabelIntTreeMap lowerCaseValue1) voidA 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, upperCaseValueSizeMethods inherited from class it.univr.di.cstnu.graph.CSTNEdgePluggable
getLabeledIntMapImplClass, getLabeledValues, getLabelsOfLabeledValues, getMinLabeledValue, getMinValue, getMinValueSubsumedBy, getValue, isCSTNEdge, labeledValuesAsString, mergeLabeledValue, mergeLabeledValues, removeLabeledValue, setLabeledValueMapMethods inherited from class it.univr.di.cstnu.graph.AbstractEdge
getConstraintType, isCSTNUEdge, isOSTNUEdge, isSTNEdge, isSTNUEdge, setConstraintType, setNameMethods inherited from class it.univr.di.cstnu.graph.AbstractComponent
addObserver, compareTo, equals, equalsByName, getName, hashCode, inNegativeCycle, removeObserver, setInNegativeCycle, takeInMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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, upperCaseValueSizeMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface it.univr.di.cstnu.graph.Component
equals, equalsByName, getName, hashCode, inNegativeCycle, setInNegativeCycle, setName, toStringMethods inherited from interface it.univr.di.cstnu.graph.CSTNEdge
getLabeledIntMapImplClass, getLabeledValues, getLabelsOfLabeledValues, getMinLabeledValue, getMinValue, getMinValueSubsumedBy, getValue, labeledValuesAsString, mergeLabeledValue, mergeLabeledValues, putLabeledValue, removeLabeledValue, setLabeledValueMapMethods 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:CSTNEdgePluggableClear all components but the name.Clear (remove) all labeled values associated with this edge.
- Specified by:
clearin interfaceComponent- Overrides:
clearin classBasicCSTNUEdgePluggable
-
clearLowerCaseValue
public void clearLowerCaseValue()Description copied from interface:BasicCSTNUEdgeClears the labeled lowercase values. For CSTNU, there is always only one value, but for some extensions, it can be more.- Specified by:
clearLowerCaseValuein interfaceBasicCSTNUEdge
-
clearLowerCaseValues
public void clearLowerCaseValues()Description copied from interface:CSTNPSUEdgeClears the labeled lowercase values.- Specified by:
clearLowerCaseValuesin 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:CSTNPSUEdgeDon't use this set for scanning that requires modifying the internal map; otherwise, this set will become invalid after the first modification.- Specified by:
getAllLowerCaseAndLabeledValuesin 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:
getLabelsOfLowerCaseValuesin interfaceCSTNPSUEdge- Parameters:
aLabel- the lower-case label- Returns:
- the set of all labels associated with lower-case label aLabel.
-
getLabelsOfLowerCaseValues
- Specified by:
getLabelsOfLowerCaseValuesin interfaceCSTNPSUEdge- Returns:
- the set of all labels associated with all lower-case labeled values;
-
getLowerCaseLabels
- Specified by:
getLowerCaseLabelsin interfaceCSTNPSUEdge- Returns:
- the set of all lower-case labels.
-
getLowerCaseValue
- Specified by:
getLowerCaseValuein interfaceCSTNPSUEdge- Parameters:
l- aLabelobject.name1- aALabelnode name.- Returns:
- the labeled lower-case value.
Constants.INT_NULLif 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:CSTNPSUEdgeDon't use this set for scanning that requires modifying the internal map; otherwise, this set will become invalid after the first modification.- Specified by:
getLowerCaseValuesin 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:
getMinLowerCaseValuein 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:
getLowerCaseValuesin 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:
hasSameValuesin interfaceEdge- Overrides:
hasSameValuesin classBasicCSTNUEdgePluggable- Parameters:
e- the other edge- Returns:
- true if it has the same values.
-
isCSTNPSUEdge
public boolean isCSTNPSUEdge()Description copied from interface:EdgeThis method is inappropriate here, but it helps to speed up the code.- Specified by:
isCSTNPSUEdgein interfaceEdge- Overrides:
isCSTNPSUEdgein classAbstractEdge- Returns:
- true if the edge is a CSTNPSU edge
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceEdge- Overrides:
isEmptyin classBasicCSTNUEdgePluggable- Returns:
- true if it does not contain any values
-
lowerCaseValueAsString
- Specified by:
lowerCaseValueAsStringin interfaceBasicCSTNUEdge- Returns:
- the representation of the lower-case value(s) of the edge.
-
lowerCaseValueSize
public final int lowerCaseValueSize()- Specified by:
lowerCaseValueSizein interfaceBasicCSTNUEdge- Returns:
- the number of lower-case value(s) of the edge.
-
mergeLabeledValue
Description copied from class:CSTNEdgePluggableMerges 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:
mergeLabeledValuein interfaceCSTNEdge- Overrides:
mergeLabeledValuein classBasicCSTNUEdgePluggable- Parameters:
l- aLabelobject.i- the new weight.- Returns:
- true if the operation was successful, false otherwise.
-
mergeLowerCaseValue
Description copied from interface:CSTNPSUEdgeMerge a lower label constraint with valueifor the node namenwith labell.- Specified by:
mergeLowerCaseValuein 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:BasicCSTNUEdgeSet 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:
putLowerCaseValuein interfaceBasicCSTNUEdge- Parameters:
l- the labelnodeName- the node name. It cannot be null.i- the new value
-
newInstance
Description copied from interface:EdgeFactory- Specified by:
newInstancein interfaceEdge- Overrides:
newInstancein classCSTNEdgePluggable- Returns:
- an object of type Edge.
-
newInstance
Description copied from interface:EdgeAny super-interfaces/implementing classes should ensure that such a method has the edge as an argument!- Specified by:
newInstancein interfaceEdge- Overrides:
newInstancein classCSTNEdgePluggable- Parameters:
edge- an object to clone.- Returns:
- an object of type Edge.
-
newInstance
Description copied from interface:EdgeFactory- Specified by:
newInstancein interfaceEdge- Overrides:
newInstancein classCSTNEdgePluggable- Parameters:
name1- of the edge- Returns:
- an object of type Edge.
-
removeLowerCaseValue
- Specified by:
removeLowerCaseValuein interfaceCSTNPSUEdge- Parameters:
l- aLabelobject.n- aALabelnode name
-
setLowerCaseValues
- Specified by:
setLowerCaseValuesin interfaceCSTNPSUEdge- Parameters:
lowerCaseValue1- the labeled lower case value to use for initializing the current one.
-
takeIn
Description copied from interface:EdgeA copy by reference of the internal structure of edge e.- Specified by:
takeInin interfaceEdge- Overrides:
takeInin 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
-