Happy to have Robocode up and running. I am working on a final semester project, where i chose to work on Robocde because it looks very fun(and well mainteined). My idea is to apply genetic algorithms and fuzzy logic for a hybrid player. For the project i only need to show that actuallty my player is "kind of smart", but i will keep playing with Robocode, it is kind of addictive.
For now i have three simple questions i hope some one could help me with.
The idea is the following:
Genetic Algorithm generates chromosomes A
Create robot with Cromosome A (sends parametrs to robot, will use them to set a neural network)
Evaluate robot with Chromosome A (play 100 rounds)
Create new population
The questions are:
How do i create a robot by passing some parameters from the BattleRunner class to the Robot Class?
-
Once i passed the parameters when creating the robot, i need to sends all useful information to my robot at each step (i.e. position of enemy, myPosition..)..The code would look something like this..Is it possible to do that? need to be done in the battleRunner class? It looks like the battleRunner class creates the players and use them to fight...but dos not handle any communication to the robot while he is fighting..
First of all, there is a lot of articles on the net about genetic algorithms and genetic programming for Robocode, e.g. on the old RoboWiki on this page.
Regarding your first question about passing parameters to a robot. There is no API for doing this in Robocode. But actually, you could do it in many ways. For example, you could write to a file, and then let the robot(s) read the file. Please notice that this requires the -DNOSECURITY=true option to be set.
You might also also try to set a system propery like System.setProperty("robot.message", "xxxx") and read it from the robot(s) using System.getProperty(..). I have not tried this out. Personally, I would prefer writing and reading to file(s).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Regarding the technical stuff for controlling the neural network or any other algorithm, it might be a good idea to ask this question on the RoboWiki as well.
I hope somebody else will be able to provide you with answers here, as I concentrate more on maintaining the game itself.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Happy to have Robocode up and running. I am working on a final semester project, where i chose to work on Robocde because it looks very fun(and well mainteined). My idea is to apply genetic algorithms and fuzzy logic for a hybrid player. For the project i only need to show that actuallty my player is "kind of smart", but i will keep playing with Robocode, it is kind of addictive.
For now i have three simple questions i hope some one could help me with.
The idea is the following:
The questions are:
How do i create a robot by passing some parameters from the BattleRunner class to the Robot Class?
The code would looke something like that:
-
Once i passed the parameters when creating the robot, i need to sends all useful information to my robot at each step (i.e. position of enemy, myPosition..)..The code would look something like this..Is it possible to do that? need to be done in the battleRunner class? It looks like the battleRunner class creates the players and use them to fight...but dos not handle any communication to the robot while he is fighting..
Do you think something like this would work to begin with? Will it learn something? Do you have suggestions?
Thank you very much. I'll be happy to share my improvements with all of you, and hopefully the Hybrid guy here will be competitive soon.
Hi Giu,
First of all, there is a lot of articles on the net about genetic algorithms and genetic programming for Robocode, e.g. on the old RoboWiki on this page.
Regarding your first question about passing parameters to a robot. There is no API for doing this in Robocode. But actually, you could do it in many ways. For example, you could write to a file, and then let the robot(s) read the file. Please notice that this requires the -DNOSECURITY=true option to be set.
You might also also try to set a system propery like System.setProperty("robot.message", "xxxx") and read it from the robot(s) using System.getProperty(..). I have not tried this out. Personally, I would prefer writing and reading to file(s).
Regarding the technical stuff for controlling the neural network or any other algorithm, it might be a good idea to ask this question on the RoboWiki as well.
I hope somebody else will be able to provide you with answers here, as I concentrate more on maintaining the game itself.
Super, Thank you very much.
That helped a lot, and yes, i did not think about writing to a text file, is much easier :)
I'll try the Robowiki as well, thank you very much.