public class BlockDude extends java.lang.Object implements DomainGenerator
Block Dude has a very large state action space that makes planning problems in it difficult. States are encoded by the player's position, facing direction, whether they are holding a block, the place of every block in the world and an int array specifying the map of the "bricks" that define the landscape.
States representing the first three levels of Block Dude can be generated from the
BlockDudeLevelConstructor
and states can be visualized with the
BlockDudeVisualizer
. You can run this class' main method
to launch an interactive visualizer for the first level with keys: w, a, d, s, x for
the actions up, west, east, pickup, putdown, respectively.
Modifier and Type | Class and Description |
---|---|
class |
BlockDude.AtExitPF
A
PropositionalFunction that takes as arguments an agent object and an exit object
and evaluates whether the agent is at the exit. |
class |
BlockDude.HoldingBlockPF
A
PropositionalFunction that takes as arguments an agent object and a block objects and evaluates whether
the agent is holding the block. |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_EAST
Name for the east action
|
static java.lang.String |
ACTION_PICKUP
Name for the pickup action
|
static java.lang.String |
ACTION_PUT_DOWN
Name for the put down action
|
static java.lang.String |
ACTION_UP
Name for the up action
|
static java.lang.String |
ACTION_WEST
Name for the west action
|
static java.lang.String |
CLASS_AGENT
Name for the agent OO-MDP class
|
static java.lang.String |
CLASS_BLOCK
Name for the block OO-MDP class
|
static java.lang.String |
CLASS_EXIT
Name for the exit OO-MDP class
|
static java.lang.String |
CLASS_MAP
Name for the bricks OO-MDP class
|
protected int |
maxx
Domain parameter specifying the maximum x dimension value of the world
|
protected int |
maxy
Domain parameter specifying the maximum y dimension value of the world
|
static java.lang.String |
PF_AT_EXIT
Name for the propositional function that tests whether the agent is at an exit
|
static java.lang.String |
PF_HOLDING_BLOCK
Name for the propositional function that tests whether the agent is holding a block.
|
protected RewardFunction |
rf |
protected TerminalFunction |
tf |
static java.lang.String |
VAR_DIR
Direction attribute name
|
static java.lang.String |
VAR_HOLD
Name for the boolean attribute that indicates whether the agent is holding a block
|
static java.lang.String |
VAR_MAP
Name for the attribute that holds the brick map
|
static java.lang.String |
VAR_X
X position attribute name
|
static java.lang.String |
VAR_Y
Y position attribute name
|
Constructor and Description |
---|
BlockDude()
Initializes a world with a maximum 25x25 dimensionality and actions that use semi-deep state copies.
|
BlockDude(int maxx,
int maxy)
Initializes a world with the maximum space dimensionality provided and actions that use semi-deep state copies.
|
Modifier and Type | Method and Description |
---|---|
OOSADomain |
generateDomain()
Returns a newly instanced Domain object
|
java.util.List<PropositionalFunction> |
generatePfs() |
int |
getMaxx() |
int |
getMaxy() |
RewardFunction |
getRf() |
TerminalFunction |
getTf() |
static void |
main(java.lang.String[] args)
Runs an interactive visual explorer for level one of Block Dude.
|
void |
setMaxx(int maxx) |
void |
setMaxy(int maxy) |
void |
setRf(RewardFunction rf) |
void |
setTf(TerminalFunction tf) |
public static final java.lang.String VAR_X
public static final java.lang.String VAR_Y
public static final java.lang.String VAR_DIR
public static final java.lang.String VAR_HOLD
public static final java.lang.String VAR_MAP
public static final java.lang.String CLASS_AGENT
public static final java.lang.String CLASS_BLOCK
public static final java.lang.String CLASS_MAP
public static final java.lang.String CLASS_EXIT
public static final java.lang.String ACTION_UP
public static final java.lang.String ACTION_EAST
public static final java.lang.String ACTION_WEST
public static final java.lang.String ACTION_PICKUP
public static final java.lang.String ACTION_PUT_DOWN
public static final java.lang.String PF_HOLDING_BLOCK
public static final java.lang.String PF_AT_EXIT
protected int maxx
protected int maxy
protected RewardFunction rf
protected TerminalFunction tf
public BlockDude()
public BlockDude(int maxx, int maxy)
maxx
- max x size of the worldmaxy
- max y size of the worldpublic RewardFunction getRf()
public void setRf(RewardFunction rf)
public TerminalFunction getTf()
public void setTf(TerminalFunction tf)
public java.util.List<PropositionalFunction> generatePfs()
public OOSADomain generateDomain()
DomainGenerator
generateDomain
in interface DomainGenerator
public int getMaxx()
public void setMaxx(int maxx)
public int getMaxy()
public void setMaxy(int maxy)
public static void main(java.lang.String[] args)
args
- can be empty.