public class TigerDomain extends java.lang.Object implements DomainGenerator
Modifier and Type | Class and Description |
---|---|
class |
TigerDomain.OpenAction
Specifies an action for opening a door.
|
class |
TigerDomain.TigerObservations
Defines the Tiger domain observation function
|
static class |
TigerDomain.TigerRF
Defines the reward function for the tiger domain, which is defined by four values:
opening the correct door with the prize; opening the wrong door with the tiger; listening; and doing nothing.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTIONDONOTHING
The do nothing action name
|
static java.lang.String |
ACTIONLEFT
The open left door action name
|
static java.lang.String |
ACTIONLISTEN
The listen action name
|
static java.lang.String |
ACTIONRIGHT
The open right door action name
|
static java.lang.String |
ATTOBSERVATION
The attribute name for an observation
|
static java.lang.String |
ATTTIGERDOOR
The attribute name that defines which door the tiger is behind
|
static java.lang.String |
CLASSOBSERVATION
The class name for observation objects
|
static java.lang.String |
CLASSTIGER
The class name for the object class that specifies where the tiger is
|
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
|
static java.lang.String |
OBHEARLEFT
The observation attribute value for hearing the tiger behind the left door.
|
static java.lang.String |
OBHEARRIGHT
The observation attribute value for hearing the tiger behind the right door
|
static java.lang.String |
OBNOTHING
The observation of hearing nothing (occurs when taking the do nothing action)
|
static java.lang.String |
OBRESET
The observation value for when reaching a new pair of doors (occurs after opening a door)
|
static java.lang.String |
VALLEFT
The discrete attribute value for the tiger being behind the left door
|
static java.lang.String |
VALRIGHT
The discrete attribtue value for the tiger being behind the right 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
|
static TabularBeliefState |
getInitialBeliefState(PODomain domain)
Generates an initial
TabularBeliefState in which the it is equally uncertain where the tiger is (50/50). |
static void |
main(java.lang.String[] args)
Main method for interacting with the tiger domain via a
TerminalExplorer . |
static StateGenerator |
randomSideStateGenerator(PODomain domain)
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(PODomain domain,
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. |
static State |
tigerLeftState(PODomain domain)
Returns the hidden state for when the tiger is behind the left door
|
static State |
tigerRightState(PODomain domain)
Returns the hidden state for when the tiger is behind the right door
|
public static final java.lang.String ATTTIGERDOOR
public static final java.lang.String ATTOBSERVATION
public static final java.lang.String CLASSTIGER
public static final java.lang.String CLASSOBSERVATION
public static final java.lang.String ACTIONLEFT
public static final java.lang.String ACTIONRIGHT
public static final java.lang.String ACTIONLISTEN
public static final java.lang.String ACTIONDONOTHING
public static final java.lang.String VALLEFT
public static final java.lang.String VALRIGHT
public static final java.lang.String OBHEARLEFT
public static final java.lang.String OBHEARRIGHT
public static final java.lang.String OBRESET
public static final java.lang.String OBNOTHING
protected boolean includeDoNothing
protected double listenAccuracy
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 Domain generateDomain()
DomainGenerator
generateDomain
in interface DomainGenerator
public static State tigerLeftState(PODomain domain)
domain
- the domainpublic static State tigerRightState(PODomain domain)
domain
- the domainpublic static StateGenerator randomSideStateGenerator(PODomain domain)
StateGenerator
that 50% of the time generates an hidden tiger state with the tiger on the
left side, and 50% time on the right.domain
- the Tiger domain objectStateGenerator
public static StateGenerator randomSideStateGenerator(PODomain domain, 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 probLeftdomain
- the Tiger domain objectprobLeft
- 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)
TerminalExplorer
.
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.