AIMA-java: JavaBean Demo
- Install aj.tgz somewhere, call that directory AIMA_HOME
- Add ${AIMA_HOME}/classes to your CLASSPATH
- Start sun's beanbox from ${AIMA_HOME}/src (see note.) To do this:
- Get the BDK from http://java.sun.com
- Unpack the BDK distribution.
This will create a "beans" directory.
- Add beans/beanbox/classes to your CLASSPATH
- Do: java sun.beanbox.BeanBoxFrame
- WARNING: If you used sun's run.sh script it will
clobber your CLASSPATH
- NOTE: The directory you start the beanbox from is
relevant only in the following indirect way:
Let DIR be the directory from which you start the beanbox.
Then the beanbox looks for its jar files in ${DIR}/../jars
- The beanbox should consist of 3 windows:
- The main window (has menus File Edit View)
- The Beans list (should contain Beanbox, RiskNoRiskGame, QLearning_Agent)
- An attribute list for BeanBox (which is itself a bean, and which has focus as default)
- Click on RiskNoRiskGame in the beans list, and click somewhere on the BeanBox.
- Wait for the RiskNoRiskGame attributes to pop up.
(This may be essentially instantaneous to painfully slow: PPro200 vs. P75)
- Set discountFactor to whatever you want.
- Set scoreDecay to whatever you want. (The performance measure for the agent
is an exponentially weighted average of correct/incorrect decision indicator variable.)
- Do the same for for QLearning_Agent, BUT: after clicking on the Beanbox, make sure to resize the
bean to some reasonable, larger, size. (It defaults to being 1 pixel big, I haven't figured out yet how to have
it not do that)
- Set numActions to 2
- Set learningRate to whatever.
- Set explorationRate to whatever.
- Do *NOT* set state to anything besides -1.
(My code is still rather fragile)
- Set the discount factor to the same as RiskNoRiskGame's.
- Set numStates to 3
- At this point, focus should still be on the Q-agent.
- Pick the menu item:
Edit -> Events -> intAction -> intActionPerformed
- This should cause a rubberband to appear from the Q-agent.
Click on the RiskNoRisk Game.
- This should cause a "please choose a target method" window to come up.
pick "intActionPerformed" and click OK.
- A "generating and compiling adaptor classes" window will pop up.
Wait for it to finish.
- Focus should now be on the RiskNoRiskGame.
Repeat a similar process as above, except choose
-> StateReward_Percept -> perceiveStateReward.
The setup is now done. Clicking on the RiskNoRiskGame will start/stop the
environemnt/learning agent interaction.
The RiskNoRiskGame will start displaying the action chosen by the agent and
also the performance measure (between 0 and 1, higher is good).
You can change the parameters dynamically and watch the performance change, etc etc.
Daishi Harada
Last modified: Thu Aug 14 13:24:47 PDT 1997