-
Notifications
You must be signed in to change notification settings - Fork 2
Introduction
Welcome to the DCOP.RRS-ADF wiki!
DCOP.RRS-ADF is an extension of RoboCupRescue Simulation(RRS) and RRS-ADF, that provides an environment to utilize any DCOP algorithm on RRS. If you need more details except for how to use, refer to our TDP on RoboCup 2019.
- Install the SERVER and RRS-ADF-SAMPLE like the following file tree:
- WORKING_DIR (e.g. $HOME/Desktop/)
+- SERVER
+- RRS-ADF-SAMPLE
- Download this extension from GitHub.
$ cd WORKING_DIR
$ git clone https://github.com/uiiaoo/dcop.rrs-adf.git
- Build it.
$ cd dcop.rrs-adf
$ gradle build
- Put the extension in the SERVER and RRS-ADF-SAMPLE.
$ cd build/libs
$ cp dcop.rrs-adf.jar WORKING_DIR/SERVER/jars
$ cp dcop.rrs-adf.jar WORKING_DIR/RRS-ADF-SAMPLE/library
Note: You have to configure on each config directory (that is paired with a scenario).
All standard config directories are located at SERVER/maps/gml/SCENARIO_NAME/config/
.
- Edit
kernel.cfg
in the directory like the following:
# kernel.communication.auto: rescuecore2.standard.kernel.comms.ChannelCommunicationModel
kernel.communication.auto: rescuedcop.rescuecore2.communication.DCOPChannelCommunicationModel
comms.channels.dcop.range: 100000 # communication range
comms.channels.dcop.bandwidth: -1 # bandwidth, -1 = unlimited
- Create a file for a task assignment module using any DCOP algorithm.
$ cd WORKING_DIR/RRS-ADF-SAMPLE
$ mkdir -p src/dcop/module/complex
$ touch src/dcop/module/complex/DCOPHumanDetector.java
- Write the following template codes to the file:
package dcop.module.complex;
import rescuedcop.adf.module.AbstractDCOPHumanDetector;
import rescuedcop.adf.communication.CustomMessageBundle;
import adf.agent.info.*;
import adf.agent.module.ModuleManager;
import adf.agent.develop.DevelopData;
import rescuecore2.worldmodel.EntityID;
import rescuecore2.misc.Pair;
public class DCOPHumanDetector extends AbstractDCOPHumanDetector
{
public DCOPHumanDetector(
AgentInfo ai, WorldInfo wi, ScenarioInfo si,
ModuleManager mm, DevelopData dd)
{
super(ai, wi, si, mm, dd);
}
@Override
protected void registerCustomMessage(CustomMessageBundle bundle)
{
}
@Override
protected void initialize()
{
}
@Override
protected Pair<EntityID, Boolean> improveAssignment()
{
return new Pair<>(null, false);
}
}
-
Write your codes on the following methods with some additional methods:
-
Pair<EntityID, Boolean> improveAssignment()
This method executes a task assignment on behalf ofcalc()
. The 1st return value means its assignment. It is called repeatedly in each step during the 2nd return value istrue
. Each agent can communicate with other agents on each call with the following two methods in it:-
List<CommunicationMessage> receive()
This method gets any messages that were received from other agents. -
void send(CommunicationMessage)
This method queues a message to the send-queue.
-
-
void initialize()
This method initializes any states related toimproveAssignment()
. It is called at the beginning of each step. -
void registerCustomMessage(CustomMessageBundle bundle)
This method registers any new message classes inheritingCommunicationMessage
. You can use them on the communication, if you implement their classes and writebundle.addClass(MESSAGE_CLASS.class)
in it.
-
-
Edit
config/module.cfg
like the following:
TacticsAmbulanceTeam.HumanDetector : dcop.module.complex.DCOPHumanDetector
Note: It is the same as the standard.