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<Object>
An implementation of CSTNUEdge where the labeled value set can be plugged during the creation.
- 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
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 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
ConstructorsConstructorDescriptionConstructor to clone the component. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all component but name.void
Clears the labeled lower case values.final LabeledALabelIntTreeMap
int
getLowerCaseValue
(Label l, ALabel name1) 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 boolean
putLowerCaseValue
(Label l, ALabel nodeName, int i) Put a lower label constraint with valuei
for the node namen
with labell
.
Putting does not make any label optimization.final int
removeLowerCaseValue
(Label l, ALabel n) void
setLowerCaseValue
(LabeledALabelIntTreeMap lowerCaseValue1) (package private) 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.void
A copy by reference of internal structure of edge e.Methods inherited from class it.univr.di.cstnu.graph.BasicCSTNUEdgePluggable
clearUpperCaseValues, getAllUpperCaseAndLabeledValuesMaps, getMinUpperCaseValue, getUpperCaseValue, getUpperCaseValueMap, mergeUpperCaseValue, pairAsString, putLabeledValue, putUpperCaseValue, removeUpperCaseValue, setUpperCaseValueAsConsidered, setUpperCaseValueMap, toString, upperCaseValueAsString, upperCaseValuesAsString, upperCaseValueSize
Methods inherited from class it.univr.di.cstnu.graph.CSTNEdgePluggable
getLabeledIntMapImplClass, getLabeledValueMap, getLabeledValueSet, getLabeledValueSet, getMinLabeledValue, getMinValue, getMinValueAmongLabelsWOUnknown, getMinValueConsistentWith, getMinValueSubsumedBy, getValue, isCSTNEdge, mergeLabeledValue, mergeLabeledValue, removeLabeledValue, setLabeledValueMap, size
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, getAllUpperCaseAndLabeledValuesMaps, getMinUpperCaseValue, getUpperCaseValue, getUpperCaseValueMap, mergeUpperCaseValue, putUpperCaseValue, removeUpperCaseValue, setUpperCaseValueMap, 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, getLabeledValueMap, getLabeledValueSet, getLabeledValueSet, getMinLabeledValue, getMinValue, getMinValueAmongLabelsWOUnknown, getMinValueConsistentWith, getMinValueSubsumedBy, getValue, mergeLabeledValue, mergeLabeledValue, putLabeledValue, removeLabeledValue, setLabeledValueMap, size
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 been already considered in the past in order to avoid to add it a second time. -
lowerCaseValue
LabeledALabelIntTreeMap lowerCaseValueMorris 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
-
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
-
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 interfaceBasicCSTNUEdge
-
getAllLowerCaseAndLabeledValuesMaps
- Specified by:
getAllLowerCaseAndLabeledValuesMaps
in interfaceCSTNPSUEdge
- Returns:
- the set of maps of labeled values and labeled lower-case ones. The maps of labeled values has ALabel empty.
-
getLowerCaseValue
- Specified by:
getLowerCaseValue
in interfaceBasicCSTNUEdge
- 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), considerBasicCSTNUEdge.getMinLowerCaseValue()
.
-
setLowerCaseValue
- Specified by:
setLowerCaseValue
in interfaceCSTNPSUEdge
- Parameters:
lowerCaseValue1
- the labeled lower case value to use for initializing the current one.
-
getLowerCaseValue
- Specified by:
getLowerCaseValue
in interfaceCSTNPSUEdge
- Parameters:
l
- aLabel
object.name1
- aALabel
node name.- Returns:
- the labeled lower-Case value object. Use
LabeledLowerCaseValue.isEmpty()
to check if it contains or not a significant value.
-
getLowerCaseValueMap
- Specified by:
getLowerCaseValueMap
in interfaceCSTNPSUEdge
- 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 interfaceBasicCSTNUEdge
- Returns:
- the minimal value (with the ALabel) among all lower-case labeled values if there are some of them, null 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 CSTNPSU edge
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in interfaceEdge
- Overrides:
isEmpty
in classBasicCSTNUEdgePluggable
- Returns:
- true if it does not contain any values
-
lowerCaseValueSize
public final int lowerCaseValueSize()- Specified by:
lowerCaseValueSize
in interfaceBasicCSTNUEdge
- Returns:
- the number of Lower-Case Labels of the edge.
-
lowerCaseValuesAsString
- Specified by:
lowerCaseValuesAsString
in interfaceBasicCSTNUEdge
- Returns:
- the representation of all Lower-Case Labels of the edge.
-
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.
-
mergeLowerCaseValue
Description copied from interface:BasicCSTNUEdge
Merge a lower label constraint with valuei
for the node namen
with labell
.- Specified by:
mergeLowerCaseValue
in interfaceBasicCSTNUEdge
- 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
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.
-
putLowerCaseValue
Description copied from interface:BasicCSTNUEdge
Put a lower label constraint with valuei
for the node namen
with labell
.
Putting does not make any label optimization.- Specified by:
putLowerCaseValue
in interfaceBasicCSTNUEdge
- 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- Returns:
- the value of the removed labeled value
-
takeIn
Description copied from interface:Edge
A copy by reference of 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 in order to avoid to consider it again in the future.- Parameters:
l
- labeln
- name of node as a-labeli
- edge weight- Returns:
- the old value associated to (l,n), or the
Constants.INT_NULL
if no value was present.
-