public final class DRecordImpl extends AbstractDRecord
DRecord.DataView
Constructor and Description |
---|
DRecordImpl(int cost,
int dataCost,
DRecord predecessor) |
DRecordImpl(long state,
int cost,
int dataCost,
DRecord predecessor,
int logMove,
int modelMove,
int backtraceSize,
int executedEvent) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
getBacktraceSize()
returns the length of the path from this record to the root of the search
|
int |
getCost() |
int |
getCostSoFar()
returns the cost so far for reaching the corresponding state
|
int |
getDataCost() |
int |
getDataState() |
DataState |
getDataState(DataStateStore store) |
double |
getEstimatedRemainingCost()
returns an underestimate for the remaining cost
|
int |
getExecutedEvents() |
int |
getHashCode() |
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.
|
int |
getNextEvent(nl.tue.astar.Delegate<? extends nl.tue.astar.Head,? extends nl.tue.astar.Tail> delegate,
nl.tue.astar.Trace trace) |
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.
|
DRecord |
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)
creates a new record, based on the operations m and l applied to the old
head.
|
DRecord |
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 |
getTotalIntegerCost() |
int |
hashCode() |
boolean |
isExactEstimate()
true if the last set estimate is exact.
|
void |
setDataCost(int dataCost) |
void |
setDataState(int dataState) |
void |
setEstimatedRemainingCost(double cost,
boolean isExactEstimate)
sets the estimate of the remaining cost.
|
void |
setHashCode(int hashCode) |
void |
setState(long state)
puts the index of the state corresponding to this record in the record.
|
java.lang.String |
toString() |
getHistory, printRecord
public DRecordImpl(long state, int cost, int dataCost, DRecord predecessor, int logMove, int modelMove, int backtraceSize, int executedEvent)
public DRecordImpl(int cost, int dataCost, DRecord predecessor)
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
nl.tue.storage.StorageException
public int getCostSoFar()
nl.tue.astar.Record
public DRecord getPredecessor()
nl.tue.astar.Record
public double getTotalCost()
nl.tue.astar.Record
public int getTotalIntegerCost()
public long getState()
nl.tue.astar.Record
public void setState(long state)
nl.tue.astar.Record
public DRecord 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)
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 boolean isExactEstimate()
nl.tue.astar.Record
public double getEstimatedRemainingCost()
nl.tue.astar.Record
public void setEstimatedRemainingCost(double cost, boolean isExactEstimate)
nl.tue.astar.Record
public int getModelMove()
nl.tue.astar.Record
public int getMovedEvent()
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
trace
- TODOpublic int getNextEvent(nl.tue.astar.Delegate<? extends nl.tue.astar.Head,? extends nl.tue.astar.Tail> delegate, nl.tue.astar.Trace trace)
public int getBacktraceSize()
nl.tue.astar.Record
public int getExecutedEvents()
public int getCost()
public int getDataCost()
public void setDataCost(int dataCost)
public DataState getDataState(DataStateStore store)
public void setDataState(int dataState)
public int getDataState()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void setHashCode(int hashCode)
public int getHashCode()
public java.lang.String toString()
toString
in class java.lang.Object