Class CTMarking
- java.lang.Object
-
- java.util.AbstractCollection<T>
-
- org.processmining.framework.util.collection.AbstractMultiSet<T,java.util.TreeMap<T,java.lang.Integer>>
-
- org.processmining.framework.util.collection.TreeMultiSet<Place>
-
- org.processmining.models.semantics.petrinet.Marking
-
- org.processmining.models.semantics.petrinet.CTMarking
-
- All Implemented Interfaces:
java.lang.Comparable<Marking>,java.lang.Iterable<Place>,java.util.Collection<Place>,org.processmining.framework.util.collection.MultiSet<Place>,org.processmining.framework.util.collection.SortedMultiSet<Place>,org.processmining.framework.util.HTMLToString
public class CTMarking extends Marking
This class represent a Marking with an addition of omega pointer. Omega is a place which has unlimited token. The class is used to represent a coverability graph.- Version:
- 1 September 2008
- Author:
- arya
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddOmegaPlace(Place p)Add a place which should be presented with omegabooleanequals(java.lang.Object o)returns true if the multisets are equal, i.e.java.util.Set<Place>getOmegaPlaces()Get a set of omega placesbooleanhasOmegaPlace()Return true if the CTMarking has omega placebooleanisLessOrEqual(org.processmining.framework.util.collection.MultiSet<Place> multiSet)returns true if this multiset is less or equal to the given multiset, i.e.Markingminus(CTMarking m)removes the elements in the given multiset from this multiset and returns a multiset indicating what was removed.booleanremove(java.lang.Object o)removes the given object from this multiset, if it is in there.protected <S extends org.processmining.framework.util.collection.MultiSet<Place>>
SremoveAllMultiSet(org.processmining.framework.util.collection.AbstractMultiSet<?,?> mset, S removed)booleanremoveOmegaPlace(Place removedItem)Remove a place from the list of omega placesbooleanretainAll(CTMarking c)Keeps all elements of the given collection in this multiset.java.lang.StringtoHTMLString(boolean includeHTMLTags)java.lang.StringtoString()New toString, to represent elements of inifinite occurrence with "w"CTMarkingtransformToOmega(java.util.Collection<Place> reference)transform all places in this CTMarking into omega.-
Methods inherited from class org.processmining.framework.util.collection.TreeMultiSet
baseSet, comparator
-
Methods inherited from class org.processmining.framework.util.collection.AbstractMultiSet
add, add, addAll, clear, contains, containsAll, containsAtLeast, hashCode, isEmpty, iterator, occurrences, removeAll, retainAll, retainAll, size, toList
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
CTMarking
public CTMarking(CTMarking collection)
Constructor with marking parameter- Parameters:
collection-
-
CTMarking
public CTMarking(java.util.Collection<Place> collection)
Constructor with collection parameter- Parameters:
collection-
-
CTMarking
public CTMarking()
Default constructor
-
-
Method Detail
-
hasOmegaPlace
public boolean hasOmegaPlace()
Return true if the CTMarking has omega place- Returns:
-
retainAll
public boolean retainAll(CTMarking c)
Keeps all elements of the given collection in this multiset. Multiplicities are taken into account.- Returns:
- true if the CTMarking changed from calling this method.
-
addOmegaPlace
public boolean addOmegaPlace(Place p)
Add a place which should be presented with omega- Parameters:
p- place which should be presented with omega- Returns:
- true if the place added successfully
-
removeOmegaPlace
public boolean removeOmegaPlace(Place removedItem)
Remove a place from the list of omega places- Parameters:
removedItem-- Returns:
- true if the place is successfully removed from the list of omega places
-
getOmegaPlaces
public java.util.Set<Place> getOmegaPlaces()
Get a set of omega places- Returns:
-
equals
public boolean equals(java.lang.Object o)
Description copied from class:org.processmining.framework.util.collection.AbstractMultiSetreturns true if the multisets are equal, i.e. if they contain the same objects with the same number of occurrences.
-
transformToOmega
public CTMarking transformToOmega(java.util.Collection<Place> reference)
transform all places in this CTMarking into omega. Omega is represented as a place CTMarking.OMEGA in place, and also listed as an item in arraylist omegaPlace- Parameters:
reference-- Returns:
-
toString
public java.lang.String toString()
New toString, to represent elements of inifinite occurrence with "w"
-
toHTMLString
public java.lang.String toHTMLString(boolean includeHTMLTags)
-
isLessOrEqual
public boolean isLessOrEqual(org.processmining.framework.util.collection.MultiSet<Place> multiSet)
returns true if this multiset is less or equal to the given multiset, i.e. all objects in this multiset should be contained in the given set and the number of occurrences in the given set is at least the number of occurrences in this multiset.- Specified by:
isLessOrEqualin interfaceorg.processmining.framework.util.collection.MultiSet<Place>- Overrides:
isLessOrEqualin classorg.processmining.framework.util.collection.AbstractMultiSet<Place,java.util.TreeMap<Place,java.lang.Integer>>- Parameters:
multiSet- the multiset to test- Returns:
- true if the given multiset is less or equal.
-
remove
public boolean remove(java.lang.Object o)
removes the given object from this multiset, if it is in there. Only one occurrence is removed, i.e. contains(o) can still be true after calling remove(o)
-
removeAllMultiSet
protected <S extends org.processmining.framework.util.collection.MultiSet<Place>> S removeAllMultiSet(org.processmining.framework.util.collection.AbstractMultiSet<?,?> mset, S removed)
-
minus
public Marking minus(CTMarking m)
removes the elements in the given multiset from this multiset and returns a multiset indicating what was removed.- Parameters:
mset- the multiset of elements needing to be removed.- Returns:
- a new multiset where the occurrences are the occurrences in this multiset, minus the occurrences in the given multiset
-
-