|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SGameController SGameFAController
public class SGameFAController
This applet demonstrates a simple game. It isn't designed to be general or reusable.
Copyright (C) 2006 David Poole.
This program gives core of the simulation. The GUI is in SGameGUI.java. The environment code is at SGameEnv.java. This function-approximation controller is at SGameFAController.java the features are defined at SGameFeatureSet.java.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Field Summary |
---|
Fields inherited from class SGameController |
---|
tracing |
Method Summary | |
---|---|
void |
doreset(double initVal)
resets the weights. |
void |
dostep(int action)
does one step. |
void |
doSteps(int count,
double greedyProb)
does count number of steps This is where you would put your controller |
double |
qvalue(int xval,
int yval,
int action)
This is gives the q-values to be drawn by the GUI. |
double[] |
toDisplay()
This can optionally return a set of real values to dosplay. |
double |
value(int xval,
int yval,
int prize,
boolean damage)
determines the value of a state the value is the maximum, for all actions, of the q-value |
Methods inherited from class SGameController |
---|
getAlpha, getAlphaFixed, getCounts, getDiscount, getEnvironment, getTitle, setAlpha, setAlphaFixed, setDiscount |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void doreset(double initVal)
doreset
in class SGameController
initVal
- the initial value given by a box in the GUIpublic void dostep(int action)
The actions are
dostep
in class SGameController
action
- the action that the agent doespublic double value(int xval, int yval, int prize, boolean damage)
xval
- the x-coordinateyval
- the y-coordinate
public void doSteps(int count, double greedyProb)
doSteps
in class SGameController
count
- the number of steps to dogreedyProb
- the probability that is step is chosen greedilypublic double qvalue(int xval, int yval, int action)
qvalue
in class SGameController
public double[] toDisplay()
SGameController
toDisplay
in class SGameController
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |