public class BlocksWorld extends java.lang.Object implements DomainGenerator
HashableStateFactory
should be object identifier dependent. For example, if using a
SimpleHashableStateFactory
, in its constructor specify identifierIndependent=false,Modifier and Type | Class and Description |
---|---|
class |
BlocksWorld.ClearPF
Propositional function class for evaluating whether one block is clear (has no block stacked on top of it).
|
class |
BlocksWorld.ColorPF
Propositional function class for evaluating whether a block is a certain color.
|
class |
BlocksWorld.OnBlockPF
Propositional function class for evaluating whether one block is on another.
|
class |
BlocksWorld.OnTablePF
Propositional function class for evaluating whether one block is on a table.
|
class |
BlocksWorld.StackAction
Action class for stacking one block onto another.
|
class |
BlocksWorld.UnstackAction
Action class for unstacking a block off of another block and putting it on the table.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTIONSTACK
Constant for the stack action name
|
static java.lang.String |
ACTIONUNSTACK
Constant for the unstack action name
|
static java.lang.String |
ATTCLEAR
Constant for the binary "clear" attribute name.
|
static java.lang.String |
ATTCOLOR
Constant for the categorical "color" attribute name.
|
static java.lang.String |
ATTONBLOCK
Constant for the relational "on" attribute name.
|
static java.lang.String |
ATTONTABLE
Constant for the binary "on table" attribute name.
|
static java.lang.String |
CLASSBLOCK
Constant for the name of the block class.
|
static java.lang.String |
COLORBLUE
Constant for the color value "blue"
|
static java.lang.String |
COLORGREEN
Constant for the color value "green"
|
static java.lang.String |
COLORRED
Constant for the color value "red"
|
static java.lang.String |
PFCLEAR
Constant for the propositional function "clear" name
|
static java.lang.String |
PFONBLOCK
Constant for the propositional function "on" name
|
static java.lang.String |
PFONTABLE
Constant for the propositional function "on table" name
|
Constructor and Description |
---|
BlocksWorld() |
Modifier and Type | Method and Description |
---|---|
Domain |
generateDomain()
Returns a newly instanced Domain object
|
static State |
getNewState(Domain d,
int nBlocks)
Creates a new state with nBlocks block objects in it.
|
static void |
main(java.lang.String[] args)
Main method for exploring the domain.
|
static void |
setBlock(ObjectInstance block,
java.lang.String onBlock,
int onTable,
int clear,
java.lang.String color)
Use this method to quickly set the various values of a block
|
static void |
setBlock(State s,
int blockInd,
java.lang.String onBlock,
int onTable,
int clear,
java.lang.String color)
Use this method to quickly set the various values of a block
|
static void |
setBlock(State s,
java.lang.String blockName,
java.lang.String onBlock,
int onTable,
int clear,
java.lang.String color)
Use this method to quickly set the various values of a block
|
static void |
setBlockColor(State s,
int blockInd,
java.lang.String color)
Use this method to quickly set the color of a block
|
public static final java.lang.String ATTONBLOCK
public static final java.lang.String ATTONTABLE
public static final java.lang.String ATTCLEAR
public static final java.lang.String ATTCOLOR
public static final java.lang.String COLORRED
public static final java.lang.String COLORGREEN
public static final java.lang.String COLORBLUE
public static final java.lang.String CLASSBLOCK
public static final java.lang.String ACTIONSTACK
public static final java.lang.String ACTIONUNSTACK
public static final java.lang.String PFONBLOCK
public static final java.lang.String PFONTABLE
public static final java.lang.String PFCLEAR
public Domain generateDomain()
DomainGenerator
generateDomain
in interface DomainGenerator
public static State getNewState(Domain d, int nBlocks)
d
- the blocks world domainnBlocks
- the number of block objects to createpublic static void setBlockColor(State s, int blockInd, java.lang.String color)
s
- the state in which the block object existsblockInd
- the index of the block object whose color value should be setcolor
- the categorical color value (either "red", "green", or "blue")public static void setBlock(State s, int blockInd, java.lang.String onBlock, int onTable, int clear, java.lang.String color)
s
- the state in which the block object should be setblockInd
- the index of the block object whose values should be setonBlock
- the relational on block valueonTable
- the binary on table valueclear
- the binary clear valuecolor
- the categorical color value (either "red", "green", or "blue")public static void setBlock(State s, java.lang.String blockName, java.lang.String onBlock, int onTable, int clear, java.lang.String color)
s
- the state in which the block object should be setblockName
- the name identifier of the block object whose values are to be set.onBlock
- the relational on block valueonTable
- the binary on table valueclear
- the binary clear valuecolor
- the categorical color value (either "red", "green", or "blue")public static void setBlock(ObjectInstance block, java.lang.String onBlock, int onTable, int clear, java.lang.String color)
block
- the block object instance to whose values should be setonBlock
- the relational on block valueonTable
- the binary on table valueclear
- the binary clear valuecolor
- the categorical color value (either "red", "green", or "blue")public static void main(java.lang.String[] args)
args
-