ix.test
Class BlockStacker
java.lang.Object
ix.test.BlockStacker
- Direct Known Subclasses:
- HtnBlockStacker, PrecondBlockStacker
public abstract class BlockStacker
- extends java.lang.Object
A useful base class for classes that run block-stacking planning problems.
It contains methods for processing problem descriptions in
a compact form:
A tower is a sequence of letters, each representing a block,
listed from highest block to lowest. For example, "abc" is a
tower with A on top of B on top of C, with C on the table.
A block-stacking problem is specified as initial-final
where initial and final are comma-separated lists of towers.
For example, "ca,b-abc" for the Sussman anomaly.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
slip
protected Slip slip
initialTowers
protected java.util.List<java.util.List<Symbol>> initialTowers
finalTowers
protected java.util.List<java.util.List<Symbol>> finalTowers
problem
protected java.lang.String problem
baseDomain
protected Domain baseDomain
S_ACHIEVE
protected static final Symbol S_ACHIEVE
S_ON
protected static final Symbol S_ON
S_BLOCK
protected static final Symbol S_BLOCK
S_CLEARTOP
protected static final Symbol S_CLEARTOP
S_TABLE
protected static final Symbol S_TABLE
S_TRUE
protected static final Symbol S_TRUE
S_FALSE
protected static final Symbol S_FALSE
BlockStacker
public BlockStacker(java.lang.String problem)
getInitialTowers
public java.util.List<java.util.List<Symbol>> getInitialTowers()
getFinalTowers
public java.util.List<java.util.List<Symbol>> getFinalTowers()
setBaseDomain
public void setBaseDomain(Domain dom)
getDefaultBaseDomainName
protected abstract java.lang.String getDefaultBaseDomainName()
findPlan
public void findPlan()
replan
public void replan()
getPlan
public Plan getPlan()
setupForPlanning
protected void setupForPlanning()
checkPlan
public void checkPlan()
parseTowers
public void parseTowers(java.lang.String problem)
towers
java.util.List<java.util.List<Symbol>> towers(java.lang.String towerDescriptions)
- Returns a list of lists, one list per tower.
towerBlocks
java.util.List<Symbol> towerBlocks(java.lang.String towerDescription)
- Returns a list of symbols representing the blocks in a tower.
checkSameBlocks
void checkSameBlocks(java.util.List<java.util.List<Symbol>> towers1,
java.util.List<java.util.List<Symbol>> towers2)
blockSet
java.util.Set<Symbol> blockSet(java.util.List<java.util.List<Symbol>> towers)
initialPlan
public Plan initialPlan()
initialPlan
public Plan initialPlan(java.util.List initialTowers,
java.util.List finalTowers)
problemDomain
public Domain problemDomain()
problemDomain
public Domain problemDomain(java.util.List initialTowers,
java.util.List finalTowers)
problemTaskRefinement
Refinement problemTaskRefinement()
initialStateRefinement
protected Refinement initialStateRefinement(java.util.List initialTowers)
goalStateRefinement
protected abstract Refinement goalStateRefinement(java.util.List finalTowers)
pattern
LList pattern(java.lang.String pat)
allBlocks
java.util.Set allBlocks(java.util.List towerLists)
worldEffect
Constraint worldEffect(LList pattern)
towerPatterns
java.util.List towerPatterns(java.util.List tower)
checkTowerState
public void checkTowerState(java.util.Map state,
java.util.List towers)
failedGoalPatterns
public java.util.List failedGoalPatterns(java.util.Map state)
incorrectTowerPatterns
public java.util.List incorrectTowerPatterns(java.util.Map state,
java.util.List towers)
checkPattern
void checkPattern(java.util.Map state,
LList pattern,
Symbol expectedValue,
java.util.List incorrectPatterns)