public class PRecord
extends java.lang.Object
implements nl.tue.astar.Record
Modifier and Type | Field and Description |
---|---|
protected int |
backtrace |
protected int |
cost |
protected double |
estimate |
protected boolean |
exact |
protected nl.tue.storage.compressor.BitMask |
executed |
protected int |
logMove |
protected int |
modelMove |
protected PRecord |
predecessor |
protected long |
state |
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 <P extends PRecord> |
getHistory(P 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() |
protected long state
protected double estimate
protected final int cost
protected final PRecord predecessor
protected final int logMove
protected final int modelMove
protected final int backtrace
protected final nl.tue.storage.compressor.BitMask executed
protected boolean exact
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.Record
getState
in interface nl.tue.astar.Record
nl.tue.storage.StorageException
public long getState()
nl.tue.astar.Record
getState
in interface nl.tue.astar.Record
public int getCostSoFar()
nl.tue.astar.Record
getCostSoFar
in interface nl.tue.astar.Record
public PRecord getPredecessor()
nl.tue.astar.Record
getPredecessor
in interface nl.tue.astar.Record
public double getTotalCost()
nl.tue.astar.Record
getTotalCost
in interface nl.tue.astar.Record
public void setState(long index)
nl.tue.astar.Record
setState
in interface nl.tue.astar.Record
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)
getNextRecord
in interface nl.tue.astar.Record
d
- 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.Record
getEstimatedRemainingCost
in interface nl.tue.astar.Record
public void setEstimatedRemainingCost(double cost, boolean isExactEstimate)
nl.tue.astar.Record
setEstimatedRemainingCost
in interface nl.tue.astar.Record
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int getModelMove()
nl.tue.astar.Record
getModelMove
in interface nl.tue.astar.Record
public static <P extends PRecord> java.util.List<P> getHistory(P r)
public static void printRecord(AbstractPDelegate<?> delegate, int trace, PRecord r)
public int getMovedEvent()
nl.tue.astar.Record
getMovedEvent
in interface nl.tue.astar.Record
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)
nl.tue.astar.Record
getNextEvents
in interface nl.tue.astar.Record
trace
- TODOpublic int getBacktraceSize()
nl.tue.astar.Record
getBacktraceSize
in interface nl.tue.astar.Record
public boolean isExactEstimate()
nl.tue.astar.Record
isExactEstimate
in interface nl.tue.astar.Record