Class PRecord
- java.lang.Object
-
- org.processmining.lpm.adjustedalignments.PRecord
-
- All Implemented Interfaces:
nl.tue.astar.Record
public class PRecord extends java.lang.Object implements nl.tue.astar.Record
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)intgetBacktraceSize()returns the length of the path from this record to the root of the searchintgetCostSoFar()returns the cost so far for reaching the corresponding statedoublegetEstimatedRemainingCost()returns an underestimate for the remaining coststatic <P extends PRecord>
java.util.List<P>getHistory(P r)intgetModelMove()return the id of the modelmove used to reach this record from previous.If none, then Move.BOTTOM is returnedintgetMovedEvent()return the index in the trace representing the event that was moved to get to this step.gnu.trove.TIntCollectiongetNextEvents(nl.tue.astar.Delegate<? extends nl.tue.astar.Head,? extends nl.tue.astar.Tail> delegate, nl.tue.astar.Trace trace)return the events in the trace that are currently enabled.PRecordgetNextRecord(nl.tue.astar.Delegate<? extends nl.tue.astar.Head,? extends nl.tue.astar.Tail> d, nl.tue.astar.Trace trace, nl.tue.astar.Head nextHead, long state, int modelMove, int movedEvent, int activity)In case of a LogMove only, then logMove>=0, modelMove == AStarThread.NOMOVE, In case of a ModelMove only, then logMove == AStarThread.NOMOVE, modelMove >=0, in case of both log and model move, then logMove>=0, modelMove>=0,PRecordgetPredecessor()returns the predecessor record.longgetState()Returns the index of the state for which this record is kept.<H extends nl.tue.astar.Head,T extends nl.tue.astar.Tail>
nl.tue.astar.impl.State<H,T>getState(nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<H,T>> storage)retrieves the state stored at index getState() from the storage.doublegetTotalCost()Method should return sum of costSoFar and estimatedCost;inthashCode()booleanisExactEstimate()true if the last set estimate is exact.static voidprintRecord(AbstractPDelegate<?> delegate, int trace, PRecord r)voidsetEstimatedRemainingCost(double cost, boolean isExactEstimate)sets the estimate of the remaining cost.voidsetState(long index)puts the index of the state corresponding to this record in the record.java.lang.StringtoString()
-
-
-
Field Detail
-
state
protected long state
-
estimate
protected double estimate
-
cost
protected final int cost
-
predecessor
protected final PRecord predecessor
-
logMove
protected final int logMove
-
modelMove
protected final int modelMove
-
backtrace
protected final int backtrace
-
executed
protected final nl.tue.storage.compressor.BitMask executed
-
exact
protected boolean exact
-
-
Method Detail
-
getState
public <H extends nl.tue.astar.Head,T extends nl.tue.astar.Tail> nl.tue.astar.impl.State<H,T> getState(nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<H,T>> storage) throws nl.tue.storage.StorageExceptionDescription copied from interface:nl.tue.astar.Recordretrieves the state stored at index getState() from the storage.- Specified by:
getStatein interfacenl.tue.astar.Record- Returns:
- Throws:
nl.tue.storage.StorageException
-
getState
public long getState()
Description copied from interface:nl.tue.astar.RecordReturns the index of the state for which this record is kept.- Specified by:
getStatein interfacenl.tue.astar.Record- Returns:
-
getCostSoFar
public int getCostSoFar()
Description copied from interface:nl.tue.astar.Recordreturns the cost so far for reaching the corresponding state- Specified by:
getCostSoFarin interfacenl.tue.astar.Record- Returns:
-
getPredecessor
public PRecord getPredecessor()
Description copied from interface:nl.tue.astar.Recordreturns the predecessor record.- Specified by:
getPredecessorin interfacenl.tue.astar.Record- Returns:
-
getTotalCost
public double getTotalCost()
Description copied from interface:nl.tue.astar.RecordMethod should return sum of costSoFar and estimatedCost;- Specified by:
getTotalCostin interfacenl.tue.astar.Record
-
setState
public void setState(long index)
Description copied from interface:nl.tue.astar.Recordputs the index of the state corresponding to this record in the record.- Specified by:
setStatein interfacenl.tue.astar.Record
-
getNextRecord
public PRecord getNextRecord(nl.tue.astar.Delegate<? extends nl.tue.astar.Head,? extends nl.tue.astar.Tail> d, nl.tue.astar.Trace trace, nl.tue.astar.Head nextHead, long state, int modelMove, int movedEvent, int activity)
In case of a LogMove only, then logMove>=0, modelMove == AStarThread.NOMOVE, In case of a ModelMove only, then logMove == AStarThread.NOMOVE, modelMove >=0, in case of both log and model move, then logMove>=0, modelMove>=0,- Specified by:
getNextRecordin interfacenl.tue.astar.Record- Parameters:
d- the delegatetrace- TODOmodelMove- the index of the transition that needs to be fired (or Move.BOTTOM if none)activity- TODO- Returns:
-
getEstimatedRemainingCost
public double getEstimatedRemainingCost()
Description copied from interface:nl.tue.astar.Recordreturns an underestimate for the remaining cost- Specified by:
getEstimatedRemainingCostin interfacenl.tue.astar.Record- Returns:
-
setEstimatedRemainingCost
public void setEstimatedRemainingCost(double cost, boolean isExactEstimate)Description copied from interface:nl.tue.astar.Recordsets the estimate of the remaining cost. The method should not be called by classes other than implementations of the AStarThread- Specified by:
setEstimatedRemainingCostin interfacenl.tue.astar.Record
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getModelMove
public int getModelMove()
Description copied from interface:nl.tue.astar.Recordreturn the id of the modelmove used to reach this record from previous.If none, then Move.BOTTOM is returned- Specified by:
getModelMovein interfacenl.tue.astar.Record- Returns:
-
getHistory
public static <P extends PRecord> java.util.List<P> getHistory(P r)
-
printRecord
public static void printRecord(AbstractPDelegate<?> delegate, int trace, PRecord r)
-
getMovedEvent
public int getMovedEvent()
Description copied from interface:nl.tue.astar.Recordreturn the index in the trace representing the event that was moved to get to this step. If none, then Move.BOTTOM is returned- Specified by:
getMovedEventin interfacenl.tue.astar.Record- Returns:
-
getNextEvents
public gnu.trove.TIntCollection getNextEvents(nl.tue.astar.Delegate<? extends nl.tue.astar.Head,? extends nl.tue.astar.Tail> delegate, nl.tue.astar.Trace trace)Description copied from interface:nl.tue.astar.Recordreturn the events in the trace that are currently enabled. In case of a linearly ordered trace, at most 1 event is returned each time.- Specified by:
getNextEventsin interfacenl.tue.astar.Recordtrace- TODO- Returns:
-
getBacktraceSize
public int getBacktraceSize()
Description copied from interface:nl.tue.astar.Recordreturns the length of the path from this record to the root of the search- Specified by:
getBacktraceSizein interfacenl.tue.astar.Record- Returns:
-
isExactEstimate
public boolean isExactEstimate()
Description copied from interface:nl.tue.astar.Recordtrue if the last set estimate is exact. If this method returns False, the Tail implementation of the A Star algorithm has to implement FastLowerBoundTail- Specified by:
isExactEstimatein interfacenl.tue.astar.Record- Returns:
-
-