public class TigerDomain extends java.lang.Object implements DomainGenerator
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_DO_NOTHING
The do nothing action name
|
static java.lang.String |
ACTION_LEFT
The open left door action name
|
static java.lang.String |
ACTION_LISTEN
The listen action name
|
static java.lang.String |
ACTION_RIGHT
The open right door action name
|
double |
correctDoorReward
the reward for opening the correct door
|
static java.lang.String |
DOOR_RESET
The observation value for when reaching a new pair of doors (occurs after opening a door)
|
static java.lang.String |
HEAR_LEFT
The observation attribute value for hearing the tiger behind the left door.
|
static java.lang.String |
HEAR_NOTHING
The observation of hearing nothing (occurs when taking the do nothing action)
|
static java.lang.String |
HEAR_RIGHT
The observation attribute value for hearing the tiger behind the right door
|
protected boolean |
includeDoNothing
Whether this domain should include the do nothing action or not
|
protected double |
listenAccuracy
The probability of hearing accurately where the tiger is
|
double |
listenReward
The reward for listening
|
double |
nothingReward
The reward for do nothing.
|
static java.lang.String |
VAL_LEFT
The discrete attribute value for the tiger being behind the left door
|
static java.lang.String |
VAL_RIGHT
The discrete attribtue value for the tiger being behind the right door
|
static java.lang.String |
VAR_DOOR
The attribute name that defines which door the tiger is behind
|
static java.lang.String |
VAR_HEAR
The variable key for an observation
|
double |
wrongDoorReward
The reward for opening the wrong door
|
Constructor and Description |
---|
TigerDomain()
Initializes.
|
TigerDomain(boolean includeDoNothing)
Initializes.
|
TigerDomain(boolean includeDoNothing,
double listenAccuracy)
Initializes
|
Modifier and Type | Method and Description |
---|---|
Domain |
generateDomain()
Returns a newly instanced Domain object
|
double |
getCorrectDoorReward() |
static TabularBeliefState |
getInitialBeliefState(PODomain domain)
Generates an initial
TabularBeliefState in which the it is equally uncertain where the tiger is (50/50). |
double |
getListenAccuracy() |
double |
getListenReward() |
double |
getNothingReward() |
double |
getWrongDoorReward() |
boolean |
isIncludeDoNothing() |
static void |
main(java.lang.String[] args)
Main method for interacting with the tiger domain via an
EnvironmentShell
By default, the TerminalExplorer interacts with the partially observable environment (SimulatedPOEnvironment ),
which means you only get to see the observations that the agent would. |
static StateGenerator |
randomSideStateGenerator()
Returns a
StateGenerator that 50% of the time generates an hidden tiger state with the tiger on the
left side, and 50% time on the right. |
static StateGenerator |
randomSideStateGenerator(double probLeft)
Returns a
StateGenerator that some of the of the time generates an hidden tiger state with the tiger on the
left side, and others on the right. |
void |
setCorrectDoorReward(double correctDoorReward) |
void |
setIncludeDoNothing(boolean includeDoNothing) |
void |
setListenAccuracy(double listenAccuracy) |
void |
setListenReward(double listenReward) |
void |
setNothingReward(double nothingReward) |
void |
setWrongDoorReward(double wrongDoorReward) |
public static final java.lang.String VAR_DOOR
public static final java.lang.String VAR_HEAR
public static final java.lang.String ACTION_LEFT
public static final java.lang.String ACTION_RIGHT
public static final java.lang.String ACTION_LISTEN
public static final java.lang.String ACTION_DO_NOTHING
public static final java.lang.String VAL_LEFT
public static final java.lang.String VAL_RIGHT
public static final java.lang.String HEAR_LEFT
public static final java.lang.String HEAR_RIGHT
public static final java.lang.String DOOR_RESET
public static final java.lang.String HEAR_NOTHING
protected boolean includeDoNothing
protected double listenAccuracy
public double correctDoorReward
public double wrongDoorReward
public double listenReward
public double nothingReward
public TigerDomain()
public TigerDomain(boolean includeDoNothing)
includeDoNothing
- if true, then the do nothing action will be included; if false, then it will not be includedpublic TigerDomain(boolean includeDoNothing, double listenAccuracy)
includeDoNothing
- if true, then the do nothing action will be included; if false, then it will not be includedlistenAccuracy
- the listen accuracypublic boolean isIncludeDoNothing()
public void setIncludeDoNothing(boolean includeDoNothing)
public double getListenAccuracy()
public void setListenAccuracy(double listenAccuracy)
public double getCorrectDoorReward()
public void setCorrectDoorReward(double correctDoorReward)
public double getWrongDoorReward()
public void setWrongDoorReward(double wrongDoorReward)
public double getListenReward()
public void setListenReward(double listenReward)
public double getNothingReward()
public void setNothingReward(double nothingReward)
public Domain generateDomain()
DomainGenerator
generateDomain
in interface DomainGenerator
public static StateGenerator randomSideStateGenerator()
StateGenerator
that 50% of the time generates an hidden tiger state with the tiger on the
left side, and 50% time on the right.StateGenerator
public static StateGenerator randomSideStateGenerator(double probLeft)
StateGenerator
that some of the of the time generates an hidden tiger state with the tiger on the
left side, and others on the right. Probability of left side is specified with the argument probLeftprobLeft
- the probability that a state with the tiger on the left side will be generatedStateGenerator
public static TabularBeliefState getInitialBeliefState(PODomain domain)
TabularBeliefState
in which the it is equally uncertain where the tiger is (50/50).domain
- the domainTabularBeliefState
in which the it is equally uncertain where the tiger is (50/50).public static void main(java.lang.String[] args)
EnvironmentShell
By default, the TerminalExplorer interacts with the partially observable environment (SimulatedPOEnvironment
),
which means you only get to see the observations that the agent would. However, if you set the first command-line argument
to be "h", then the explorer will explorer the underlying fully observable MDP states.args
- either empty or ["h"]; provide "h" to explorer the underlying fully observable tiger MDP.