Discussion:
Integrating JADE and Robocode to develop a Multi-Robot System using TeamRobot class
n***@gmail.com
2014-08-28 14:05:48 UTC
Permalink
Hi everyone!

I'm trying to implement Robocode and JADE (http://jade.tilab.com/) library
to develop a multi-robot based in escorting and entrapment application
system using TeamRobot class, integrating Robocode robot as an agent,
behaviours extending Behaviour class from Jade and also FIPA-ACL to the
communication between the TeamRobot.

For example, to put an agent in society, I need to extend Agent native
class from jade in the myAgent class, but at the same I need to extend
Robot. How do implement to relate a Robot as an Agent? One more this: once
I got integrate those classes, is it possible develop FIPA-ACL
communication in robots?

Does someone know how to do it?

I'm really need help!

There are below something I've tried to do. In myAgent class I instantiated
myRobot object to try to get a connection between Robot and Agent. However,
I'm not true if I'm in the right way...

MyAgent Class: ------------------------
package BenderRobot;



import jade.core.Agent;
import robocode.*;

public class BenderAgent extends Agent{

protected void setup() {
BenderRobot bender = new BenderRobot();
bender.getRobotRunnable();
}



}


MyRobot Class:------------------------
package BenderRobot;



import robocode.*;
import jade.core.Agent;

//primeiras tentativas com robocode e jade
class BenderRobot extends Robot {
/* Robot robot = new Robot();
string name = robot.getName(); */



public void run() {
while(true) {
// Replace the next 4 lines with any behavior you would like
ahead(100);
turnGunRight(360);
back(100);
turnGunRight(360);
}
}

}
--
You received this message because you are subscribed to the Google Groups "robocode" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robocode+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Pavel Šavara
2014-08-28 21:52:29 UTC
Permalink
Hi Nathalia

You could probably use composition together with inheritance. Just include
the JADE agent (could be your inherited class) as member of Robot class.
https://stackoverflow.com/questions/49002/prefer-composition-over-inheritance

Also note that you could be able to implement ITeamRobot interface instead
of inheriting from TeamRobot base class with same result from robocode
viewpoint. It would probably be more work, thought.
http://robocode.sourceforge.net/docs/robocode/robocode/robotinterfaces/ITeamRobot.html
http://robocode.sourceforge.net/docs/robocode/robocode/robotinterfaces/IAdvancedRobot.html


Regarding the communication, it seems to me that FIPA uses it's own
communication network layer. That is against rules in robocode and it is
prevented by security system. The security system could be turned off by
commandline switch.
But i would say that the whole idea of this framework and communication is
probably overkill for such simple environment like robocode.

Such framework is probably too complex for you at the very start of your
journey.
I suggest that you give up the framework and try to inspire yourself with
other robot team implementations available on the internet and robowiki.
http://robocode.sourceforge.net/docs/robocode/robocode/robotinterfaces/ITeamEvents.html
http://robocode.sourceforge.net/docs/robocode/robocode/TeamRobot.html#sendMessage(java.lang.String,
java.io.Serializable)


As you become stronger with robocode and programming you could return to
the JADE framework and replace your own simle communication layer with it
later.
Start here
http://robowiki.net/wiki/Teams

Cheers
Pavel
Post by n***@gmail.com
Hi everyone!
I'm trying to implement Robocode and JADE (http://jade.tilab.com/)
library to develop a multi-robot based in escorting and entrapment
application system using TeamRobot class, integrating Robocode robot as an
agent, behaviours extending Behaviour class from Jade and also FIPA-ACL to
the communication between the TeamRobot.
For example, to put an agent in society, I need to extend Agent native
class from jade in the myAgent class, but at the same I need to extend
Robot. How do implement to relate a Robot as an Agent? One more this: once
I got integrate those classes, is it possible develop FIPA-ACL
communication in robots?
Does someone know how to do it?
I'm really need help!
There are below something I've tried to do. In myAgent class I
instantiated myRobot object to try to get a connection between Robot and
Agent. However, I'm not true if I'm in the right way...
MyAgent Class: ------------------------
package BenderRobot;
import jade.core.Agent;
import robocode.*;
public class BenderAgent extends Agent{
protected void setup() {
BenderRobot bender = new BenderRobot();
bender.getRobotRunnable();
}
}
MyRobot Class:------------------------
package BenderRobot;
import robocode.*;
import jade.core.Agent;
//primeiras tentativas com robocode e jade
class BenderRobot extends Robot {
/* Robot robot = new Robot();
string name = robot.getName(); */
public void run() {
while(true) {
// Replace the next 4 lines with any behavior you would like
ahead(100);
turnGunRight(360);
back(100);
turnGunRight(360);
}
}
}
--
You received this message because you are subscribed to the Google Groups "robocode" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "robocode" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robocode+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...