Package nl.tue.astar.impl.memefficient
Class MemoryEfficientStorageHandler<H extends Head,T extends Tail>
- java.lang.Object
-
- nl.tue.astar.impl.memefficient.MemoryEfficientStorageHandler<H,T>
-
- All Implemented Interfaces:
AbstractAStarThread.StorageHandler<H,T>
public class MemoryEfficientStorageHandler<H extends Head,T extends Tail> extends java.lang.Object implements AbstractAStarThread.StorageHandler<H,T>
-
-
Field Summary
Fields Modifier and Type Field Description protected MemoryEfficientAStarAlgorithm<H,T>algorithmprotected StorageAwareDelegate<H,T>delegateprotected java.util.concurrent.locks.ReentrantReadWriteLocklockprotected CompressedHashSet<State<H,T>>statespaceprotected CompressedStore<State<H,T>>store
-
Constructor Summary
Constructors Constructor Description MemoryEfficientStorageHandler(MemoryEfficientAStarAlgorithm<H,T> algorithm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetEstimate(H head, long index)return the estimate of the tail for the given head.longgetIndexOf(H head)State<H,T>getStoredState(Record rec)<TT extends FastLowerBoundTail>
voidreComputeFastLowerboundTail(Record rec, TT tail, H head, int storedEstimate)implementations may assume that TT == TvoidstoreStateForRecord(State<H,T> state, Record newRec)
-
-
-
Field Detail
-
algorithm
protected final MemoryEfficientAStarAlgorithm<H extends Head,T extends Tail> algorithm
-
delegate
protected final StorageAwareDelegate<H extends Head,T extends Tail> delegate
-
lock
protected final java.util.concurrent.locks.ReentrantReadWriteLock lock
-
-
Constructor Detail
-
MemoryEfficientStorageHandler
public MemoryEfficientStorageHandler(MemoryEfficientAStarAlgorithm<H,T> algorithm)
-
-
Method Detail
-
storeStateForRecord
public void storeStateForRecord(State<H,T> state, Record newRec) throws AStarException
- Specified by:
storeStateForRecordin interfaceAbstractAStarThread.StorageHandler<H extends Head,T extends Tail>- Throws:
AStarException
-
getIndexOf
public long getIndexOf(H head) throws AStarException
- Specified by:
getIndexOfin interfaceAbstractAStarThread.StorageHandler<H extends Head,T extends Tail>- Throws:
AStarException
-
getStoredState
public State<H,T> getStoredState(Record rec) throws AStarException
- Specified by:
getStoredStatein interfaceAbstractAStarThread.StorageHandler<H extends Head,T extends Tail>- Throws:
AStarException
-
getEstimate
public int getEstimate(H head, long index) throws AStarException
Description copied from interface:AbstractAStarThread.StorageHandlerreturn the estimate of the tail for the given head. The head is stored at the given index.- Specified by:
getEstimatein interfaceAbstractAStarThread.StorageHandler<H extends Head,T extends Tail>- Returns:
- Throws:
AStarException
-
reComputeFastLowerboundTail
public <TT extends FastLowerBoundTail> void reComputeFastLowerboundTail(Record rec, TT tail, H head, int storedEstimate) throws AStarException
Description copied from interface:AbstractAStarThread.StorageHandlerimplementations may assume that TT == T- Specified by:
reComputeFastLowerboundTailin interfaceAbstractAStarThread.StorageHandler<H extends Head,T extends Tail>- Throws:
AStarException
-
-