public class MacroCellGridWorld extends GridWorldDomain
Modifier and Type | Class and Description |
---|---|
static class |
MacroCellGridWorld.InMacroCellPF
A propositional function for detecting if the agent is in a specific macro cell.
|
static class |
MacroCellGridWorld.LinearInPFRewardFunction
RewardFunction class that returns rewards based on a linear combination of propositional functions
|
GridWorldDomain.AtLocationPF, GridWorldDomain.MovementAction, GridWorldDomain.WallToPF
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULTHEIGHT |
static int |
DEFAULTWIDTH |
protected int |
macroCellHorizontalCount
The number of columns of macro cells (cells across the y-axis)
|
protected int |
macroCellVerticalCount
The number of rows of macro cells (cells across the x-axis)
|
ACTIONEAST, ACTIONNORTH, ACTIONSOUTH, ACTIONWEST, ATTLOCTYPE, ATTX, ATTY, CLASSAGENT, CLASSLOCATION, height, map, numLocationTypes, PFATLOCATION, PFWALLEAST, PFWALLNORTH, PFWALLSOUTH, PFWALLWEST, transitionDynamics, width
Constructor and Description |
---|
MacroCellGridWorld()
Initializes with a default world size of 32x32 and macro cell size of 16x16.
|
MacroCellGridWorld(int width,
int height,
int macroCellWidth,
int macroCellHeight)
Initializes with the given world width/height and macro-cell width/height
|
Modifier and Type | Method and Description |
---|---|
Domain |
generateDomain()
Returns a newly instanced Domain object
|
static MacroCellGridWorld.LinearInPFRewardFunction |
generateRandomMacroCellRF(PropositionalFunction[] functions)
Given an array of macro-cell propositional functions, returns a random reward function that is a linear combination of them.
|
static java.util.Map<java.lang.String,java.lang.Double> |
generateRandomRewardsMap(PropositionalFunction[] functions)
Given an array of macro-cell propositional functions, returns a random reward weight to be associated with them which
can then be used to create a reward function.
|
int |
getMacroCellHorizontalCount()
Returns the number of columns of macro-cells (cells across the x-axis)
|
static PropositionalFunction[] |
getMacroCellPropositionalFunctions(Domain domain,
MacroCellGridWorld gridWorld)
Returns an array of the propositional functions that detect if the agent is in a macro cell.
|
int |
getMacroCellVerticalCount()
Returns the number of rows of macro-cells (cells across the y-axis)
|
static State |
getRandomInitialState(GridWorldDomain gridWorldGenerator,
Domain d)
Returns a random initial state in a world with no location objects.
|
void |
setMacroCellHorizontalCount(int vCount)
Sets the number of coumns of macro-cells (cells across the x-axis)
|
void |
setMacroCellVerticalCount(int vCount)
Sets the number of rows of macro-cells (cells across the y-axis)
|
clearLocationOfWalls, getGridWorldValueFunctionVisualization, getHeight, getMap, getOneAgentNLocationState, getOneAgentNoLocationState, getOneAgentNoLocationState, getOneAgentOneLocationState, getWidth, horizontal1DNorthWall, horizontalWall, main, makeEmptyMap, move, movementDirectionFromIndex, set1DEastWall, set1DNorthWall, setAgent, setCellWallState, setDeterministicTransitionDynamics, setLocation, setLocation, setMap, setMapToFourRooms, setNumberOfLocationTypes, setObstacleInCell, setProbSucceedTransitionDynamics, setTransitionDynamics, vertical1DEastWall, verticalWall
public static final int DEFAULTHEIGHT
public static final int DEFAULTWIDTH
protected int macroCellVerticalCount
protected int macroCellHorizontalCount
public MacroCellGridWorld()
public MacroCellGridWorld(int width, int height, int macroCellWidth, int macroCellHeight)
width
- the width of the worldheight
- the height of the worldmacroCellWidth
- the macro-cell width of the worldmacroCellHeight
- the macro-cell height of the worldpublic int getMacroCellVerticalCount()
public int getMacroCellHorizontalCount()
public void setMacroCellVerticalCount(int vCount)
vCount
- the number of rows of macro-cells (cells across the y-axis)public void setMacroCellHorizontalCount(int vCount)
vCount
- the number of coumns of macro-cells (cells across the x-axis)public Domain generateDomain()
DomainGenerator
generateDomain
in interface DomainGenerator
generateDomain
in class GridWorldDomain
public static State getRandomInitialState(GridWorldDomain gridWorldGenerator, Domain d)
gridWorldGenerator
- the grid world generator containing the mapd
- the domain object to which the state will be associatedpublic static PropositionalFunction[] getMacroCellPropositionalFunctions(Domain domain, MacroCellGridWorld gridWorld)
domain
- the domain object containing the propositional functions.gridWorld
- the MacroCellGridWorld
domain generator.public static MacroCellGridWorld.LinearInPFRewardFunction generateRandomMacroCellRF(PropositionalFunction[] functions)
functions
- the macro cell propositional functions.public static java.util.Map<java.lang.String,java.lang.Double> generateRandomRewardsMap(PropositionalFunction[] functions)
functions
- the macro cell propositional functions.