public class PRecord
extends java.lang.Object
implements nl.tue.astar.Record
| Constructor and Description |
|---|
PRecord(int cost,
PRecord predecessor,
int markingsize,
int traceLength) |
PRecord(long state,
int cost,
PRecord predecessor,
int logMove,
int modelMove,
int markingsize,
int backtrace,
nl.tue.storage.compressor.BitMask executed) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
int |
getBacktraceSize()
returns the length of the path from this record to the root of the search
|
int |
getCostSoFar()
returns the cost so far for reaching the corresponding state
|
double |
getEstimatedRemainingCost()
returns an underestimate for the remaining cost
|
static java.util.List<PRecord> |
getHistory(PRecord r) |
int |
getModelMove()
return the id of the modelmove used to reach this record from previous.If
none, then Move.BOTTOM is returned
|
int |
getMovedEvent()
return the index in the trace representing the event that was moved to
get to this step.
|
gnu.trove.TIntCollection |
getNextEvents(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.
|
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,
|
PRecord |
getPredecessor()
returns the predecessor record.
|
long |
getState()
Returns the index of the state for which this record is kept.
|
<H extends nl.tue.astar.Head,T extends nl.tue.astar.Tail> |
getState(nl.tue.storage.CompressedStore<nl.tue.astar.impl.State<H,T>> storage)
retrieves the state stored at index getState() from the storage.
|
double |
getTotalCost()
Method should return sum of costSoFar and estimatedCost;
|
int |
hashCode() |
boolean |
isExactEstimate()
true if the last set estimate is exact.
|
static void |
printRecord(AbstractPDelegate<?> delegate,
int trace,
PRecord r) |
void |
setEstimatedRemainingCost(double cost,
boolean isExactEstimate)
sets the estimate of the remaining cost.
|
void |
setState(long index)
puts the index of the state corresponding to this record in the record.
|
java.lang.String |
toString() |
public PRecord(long state,
int cost,
PRecord predecessor,
int logMove,
int modelMove,
int markingsize,
int backtrace,
nl.tue.storage.compressor.BitMask executed)
public PRecord(int cost,
PRecord predecessor,
int markingsize,
int traceLength)
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.StorageException
nl.tue.astar.RecordgetState in interface nl.tue.astar.Recordnl.tue.storage.StorageExceptionpublic long getState()
nl.tue.astar.RecordgetState in interface nl.tue.astar.Recordpublic int getCostSoFar()
nl.tue.astar.RecordgetCostSoFar in interface nl.tue.astar.Recordpublic PRecord getPredecessor()
nl.tue.astar.RecordgetPredecessor in interface nl.tue.astar.Recordpublic double getTotalCost()
nl.tue.astar.RecordgetTotalCost in interface nl.tue.astar.Recordpublic void setState(long index)
nl.tue.astar.RecordsetState in interface nl.tue.astar.Recordpublic 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)
getNextRecord in interface nl.tue.astar.Recordd - the delegatetrace - TODOmodelMove - the index of the transition that needs to be fired (or
Move.BOTTOM if none)activity - TODOpublic double getEstimatedRemainingCost()
nl.tue.astar.RecordgetEstimatedRemainingCost in interface nl.tue.astar.Recordpublic void setEstimatedRemainingCost(double cost,
boolean isExactEstimate)
nl.tue.astar.RecordsetEstimatedRemainingCost in interface nl.tue.astar.Recordpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic int getModelMove()
nl.tue.astar.RecordgetModelMove in interface nl.tue.astar.Recordpublic static void printRecord(AbstractPDelegate<?> delegate, int trace, PRecord r)
public int getMovedEvent()
nl.tue.astar.RecordgetMovedEvent in interface nl.tue.astar.Recordpublic gnu.trove.TIntCollection getNextEvents(nl.tue.astar.Delegate<? extends nl.tue.astar.Head,? extends nl.tue.astar.Tail> delegate,
nl.tue.astar.Trace trace)
nl.tue.astar.RecordgetNextEvents in interface nl.tue.astar.Recordtrace - TODOpublic int getBacktraceSize()
nl.tue.astar.RecordgetBacktraceSize in interface nl.tue.astar.Recordpublic boolean isExactEstimate()
nl.tue.astar.RecordisExactEstimate in interface nl.tue.astar.Record