public class TreeRecord
extends java.lang.Object
implements nl.tue.astar.Record
Constructor and Description |
---|
TreeRecord(int cost,
gnu.trove.list.TIntList internalMoves,
int internalMoveCost,
int traceLength,
boolean isExact) |
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<TreeRecord> |
getHistory(TreeRecord r) |
int[] |
getInternalMoves() |
double |
getInternalMovesCost() |
int |
getModelMove()
return the id of the modelmove used to reach this record from previous.If
none, then Move.BOTTOM is returned
|
int |
getModelMoveCount() |
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.
|
TreeRecord |
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,
|
TreeRecord |
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() |
static boolean |
isConsistent(TreeRecord newRecord,
nl.tue.astar.Trace originalTrace,
NAryTree tree,
int scaling) |
boolean |
isExactEstimate()
true if the last set estimate is exact.
|
static void |
printRecord(TreeDelegate<?,?> delegate,
nl.tue.astar.Trace trace,
TreeRecord r) |
void |
setEstimatedRemainingCost(double estimate,
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 TreeRecord(int cost, gnu.trove.list.TIntList internalMoves, int internalMoveCost, int traceLength, boolean isExact)
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 double getTotalCost()
nl.tue.astar.Record
getTotalCost
in interface nl.tue.astar.Record
public TreeRecord getPredecessor()
nl.tue.astar.Record
getPredecessor
in interface nl.tue.astar.Record
public void setState(long index)
nl.tue.astar.Record
setState
in interface nl.tue.astar.Record
public TreeRecord 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 estimate, 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 java.util.List<TreeRecord> getHistory(TreeRecord r)
public static void printRecord(TreeDelegate<?,?> delegate, nl.tue.astar.Trace trace, TreeRecord 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 getModelMoveCount()
public int[] getInternalMoves()
public double getInternalMovesCost()
public boolean isExactEstimate()
nl.tue.astar.Record
isExactEstimate
in interface nl.tue.astar.Record
public int getBacktraceSize()
nl.tue.astar.Record
getBacktraceSize
in interface nl.tue.astar.Record
public static boolean isConsistent(TreeRecord newRecord, nl.tue.astar.Trace originalTrace, NAryTree tree, int scaling)