YabAPI is a bare essential API to develop an RoboCupRescue agent (RCR agent) in Java. The developers have to only describe action of each unit time and reaction to auditory information in a skeleton of an agent, as follows.
import java.net.*; import java.util.*; import yab.agent.*; import yab.agent.object.*; class FireBrigadeAgent extends AbstractFireBrigadeAgent { FireBrigadeAgent(InetAddress address, int port) { super(address, port); } protected void act() throws ActionCommandException { Collection fires = isBurning.extract(world.buildings); extinguishNearFire(fires); moveToFire(fires); } protected void extinguishNearFire(Collection fires) throws ActionCommandException { Collection nearFires = isNear.extract(fires); if (!nearFires.isEmpty()) extinguish((Building) burningTime.min(nearFires)); } protected void moveToFire(Collection fires) throws ActionCommandException { if (!fires.isEmpty()) move(entrance.collect(fires)); } protected void hear(RealObject sender, String message) { // reaction to auditory information } }
Tha latest version of YabAPI is available at http://ne.cs.uec.ac.jp/~morimoto/rescue/yabapi/.
YabAPI consists of four packages:
There are documents for YabAPI:
% tar zxvf yabapi-X.XX.tar.gz
% java samaple.Main [<cv> <fb> <fs> <at> <ac> <pf> <po> [<host> [<port>]]] <cv> the number of civilian agents, or '-' to connect agents as much as the kernel accepts <fb> the number of fire brigade agents or '-' <fs> the number of fire station agents or '-' <at> the number of ambulance team agents or '-' <ac> the number of ambulance center agents or '-' <pf> the number of police force agents or '-' <po> the number of police office agents or '-' <host> kernel host (defalut : localhost) <port> kernel port (default : 6000) If the numbers of agents are not given, this program tries to connect all type agents as much as the kernel accepts.
To execute all agents except for civilian agents, run the following command.
% java -jar yabapi-X.XX/sample.jar 0 - - - - - - HOST_WHERE_THE_KERNEL_IS_RUNNING
Version | Date | Source Files and Documents | Requirements |
---|---|---|---|
1.00 | Nov. 10th 2002 | yabapi-1.00.tar.gz | Java 1.4 |