SoccerBeans is an agent framework for the RoboCup domain. It is used as a research and educational tool for our graduate level course on Multiagent Systems. SoccerBeans builds on our previous work - Biter, and inherits all the features from its predecessor. Some of the other salient characteristics of the software are as follows:
In this tutorial, you will learn how to create and run a simple player that can dribble the ball to goal using the SoccerBeans framework.
/acct/f1/jmvidal/SUN/rcsoccersim-9.0.3. Run the shell script
run.shfile at the location
#!/bin/sh export PATH PATH=/usr/local/java1.3/bin:$PATH export CLASSPATH CLASSPATH=classes:../infobus.jar:../lib/methodtracer.jar java sun.beanbox.BeanBoxFramewhere,
$(BDK_HOME)represents the BDK installation directory.
.rcssserver-server.conf, from the soccer server's home directory to the
$(BDK_HOME)/beans/beanboxdirectory. The SoccerBeans package includes a sample server configuration file. Students at USC must use the server configuration file defined in FP and rename it to
$(BDK_HOME)/beans/jars/directory. To avoid inconvenience, move all the other contents of the directory to some new location.
$(BDK_HOME)/beans/beanboxdirectory. Four windows - BeanBox, Toolbox, Properties and Method Tracer, will appear. Also, the Toolbox will have all the beans from the SoccerBeans package.
PlayerFoundationbean from the Toolbox window and then click somewhere in the top section of the BeanBox window. We now have a soccer player that can play the game, if we tell it what to do.
Activitybean in the BeanBox, as shown in the adjacent figure. Change it's name property to
Observeactivity, namely the
DInputTypebean, the two
BBooleanbeans and the
BIncorporateObservationbean on the BeanBox.
DInputTypebean in the BeanBox. It's inputType property must be set to
SensorInput. Now select the
Observeactivity bean, and from the
Editmenu, go to
Events > canHandle Decision > decide. A red line will appear connecting the mouse pointer to the activity bean. Then click on the
DInputTypebean, and in the window that appears, select
OKit. By this action, we say that the
Observeactivity can be handled or executed by the player when a particular condition on the type of the input received from the soccer server is satisfied. The
canHandle Decision > decideevent was selected for the source bean (Activity) because the listener bean (DInputType) was a decision bean.
BBooleanbean. By default, the bean's properties are set such that it sets the canHandle property of the concerned activity to
true. Now select the
DInputTypebean, and go
Edit > Events > then behave > behave. Select the first
BBooleanbean and say
OK. Here we say that if the received input type is a
seemessage from the server (see the server manual for more information), then the concerned activity, i.e.
Observe, can be handled. The
then behave > behaveevent was selected for the source bean (DInputType) in this case, as the listener bean (BBoolean) was a behavior bean.
BBooleanbean. Change it's value property to
false. Then select the
Edit > Events > else behave > behave, select the second
BBooleanbean, and say
OK. Here we say that if the received input type is not a
SensorInput, then the
Observeactivity cannot be executed by the player for the current simulation step.
BIncorporateObservationbean has no properties. Select the
Observeactivity bean, go
Edit > handle Behavior > behave, select the
BIncorporateObservationbean, and say
OK. Here we described how the player will execute the activity, should the player's scheduling mechanism select this activity for execution in the current simulation cycle. We say that the player will simply call the
BIncorporateObservationbean to handle the current activity.
Observeactivity to the player. For this, select the
PlayerFoundationbean can generate an
addActivityevent, so go
Edit > Events > activity > add activity, then select the
Observeactivity bean, and select it's
addActivitymethod. Repeat the process for the
handleevents, associating those with the
handlemethods of the activity bean. We have now successfully designed one activity for our player.
BDribblebeans from the Toolbox onto the BeanBox, as shown in the adjacent diagram.
Activitybean and modify it's name property to
Dribble. Associate the activity's
canHandle Behavior > behaveevent with the
behavemethod of the
BBooleanbean, and the
handle behavior > behaveevent with the
behavemethod of the
BDribblebean. The default properties of the
BDribblebean are set such that the player dribbles the ball to the opposite goal. Here we tell the player to execute this activity all the time.
Dribbleactivity with the player exactly as we associated the
Observeactivity, as the player should always have the correct picture of it's environment. To do this, select the
Observeactivity, and for it's inhibits property, say
Dribble. So, we tell tha player to
Dribbleall the time, but whenever it can
Observe, it must.
PlayerFoundationbean in the BeanBox. The default values for the player's properties serve our current purpose, so we won't modify them. Simply set the online property to
true. A player should appear on the soccer monitor. Click on kick-off and the player will do what we taught it.
ClassNotFoundExceptionbeing thrown. The players in the sample team were developed in multiple sessions.
File > Loadoption, and saved by the
File > Saveoption in the BDK.
sampleteamfolder in the SoccerBeans package has 23 files for the 23 different sessions that the 11 players are created in. The
observesession is the first session for all the players, and is always followed by the
startplaysession. The rest of the session files are named such that the alphabetically increasing order of individual player session files represents the actual session order for the player. So, to load
player1completely, we will have to load the following files in the specified order -
observe, startplay, player1a, player1b, player1c,and
player1d.Note that some of the session files are shared by multiple players -
player2a3ais the third session for both
player4c5c6cis the fifth session for
SoccerBeans was written by Hrishikesh Goradia. Biter was written by Paul Buhler, Shaun Wood, and José M. Vidal.