|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectPinBallDomain.PinBall
public class PinBall
Primary PinBall domain class.
This class can be mostly be dealt with directly,
example code for an agent selecting actions randomly is in
main
.
Field Summary | |
---|---|
static int |
ACC_X
|
static int |
ACC_Y
|
static int |
DEC_X
|
static int |
DEC_Y
|
static double |
END_EPISODE
|
static int |
NONE
|
static double |
STEP_PENALTY
|
static double |
THRUST_PENALTY
|
Constructor Summary | |
---|---|
PinBall()
Constructor: create an empty PinBall domain. |
|
PinBall(java.lang.String configfile)
Constructor: load the domain from a configuration file. |
|
PinBall(java.lang.String configfile,
Ball b)
Constructor: load the domain from a file, with a specified initial ball position. |
Method Summary | |
---|---|
void |
addObstacle(Obstacle o)
Add an obstacle to the domain. |
void |
deleteObstacle(int pos)
Removes the obstacle at a given position. |
boolean |
episodeEnd()
Check for end of episode. |
boolean |
episodeEnd(Ball b)
Check if the episode would be over, given a ball position. |
Ball |
getBall()
Get the ball object. |
Point |
getIntercept()
Get the position of the last intercept. |
int |
getNumActions()
Get the number of actions available in the domain |
java.util.ArrayList<Obstacle> |
getObstacles()
Get a list of the obstacles. |
java.util.ArrayList<PinBallState> |
getStartStates()
Get the list of start positions for the ball. |
PinBallState |
getState()
Get current state. |
Target |
getTarget()
Get the target object. |
void |
loadFromFile(java.lang.String configfile)
Load the domain from a file. |
static void |
main(java.lang.String[] args)
Main. |
double |
step(int act)
Given an action, advance the domain one step and return a reward. |
void |
writeToFile(java.lang.String configfile)
Write the current domain configuration to a file. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ACC_X
public static final int ACC_Y
public static final int DEC_X
public static final int DEC_Y
public static final int NONE
public static final double STEP_PENALTY
public static final double THRUST_PENALTY
public static final double END_EPISODE
Constructor Detail |
---|
public PinBall(java.lang.String configfile)
configfile
- the configuration file name.public PinBall(java.lang.String configfile, Ball b)
configfile
- configuration file nameb
- ballpublic PinBall()
Method Detail |
---|
public static void main(java.lang.String[] args)
args
- command-line arguments: ignoredpublic void writeToFile(java.lang.String configfile)
configfile
- the configuration input filepublic void loadFromFile(java.lang.String configfile)
configfile
- the file namepublic java.util.ArrayList<Obstacle> getObstacles()
public Ball getBall()
public Target getTarget()
public PinBallState getState()
public double step(int act)
act
- the action
public boolean episodeEnd()
true
if the episode is over, false
otherwisepublic boolean episodeEnd(Ball b)
b
- the ball
true
if the episode would be over, false
otherwisepublic java.util.ArrayList<PinBallState> getStartStates()
public void addObstacle(Obstacle o)
o
- the new obstaclepublic void deleteObstacle(int pos)
pos
- position of the obstacle to removepublic Point getIntercept()
public int getNumActions()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |