Skip to content

Introduction

Yuki MIYAMOTO edited this page Mar 3, 2022 · 15 revisions

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.

Installation

  1. Install the SERVER and RRS-ADF-SAMPLE like the following file tree:
- WORKING_DIR (e.g. $HOME/Desktop/)
    +- SERVER
    +- RRS-ADF-SAMPLE
  1. Download this extension from GitHub.
$ cd WORKING_DIR
$ git clone https://github.com/uiiaoo/dcop.rrs-adf.git
  1. Build it.
$ cd dcop.rrs-adf
$ gradle build
  1. 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

Configuration

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/.

  1. 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

Development

  1. 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
  1. 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);
    }
}
  1. Write your codes on the following methods with some additional methods:

    • Pair<EntityID, Boolean> improveAssignment()
      This method executes a task assignment on behalf of calc(). The 1st return value means its assignment. It is called repeatedly in each step during the 2nd return value is true. 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 to improveAssignment(). It is called at the beginning of each step.

    • void registerCustomMessage(CustomMessageBundle bundle)
      This method registers any new message classes inheriting CommunicationMessage. You can use them on the communication, if you implement their classes and write bundle.addClass(MESSAGE_CLASS.class) in it.

  2. Edit config/module.cfg like the following:

TacticsAmbulanceTeam.HumanDetector : dcop.module.complex.DCOPHumanDetector

Boot

Note: It is the same as the standard.

Clone this wiki locally