Learning Track Help

126 views
Skip to first unread message

Jamie Hickman

unread,
Apr 4, 2013, 8:36:06 PM4/4/13
to mariocom...@googlegroups.com
Hi guys,

I am currently working through an Evolutionary Computation module at University and one of the assignments tasks us with creating some form of Evolutionary Algorithm for the Mario AI learning track.

I am fairly new to the Maro AI, and after playing around with it, I am having trouble getting the evolutionary stuff working. At the moment I am currently playing around with the SimpleMLPAgent, but when I run it with ch.idsia.scenarios.Play it only seems to run the once, but because it is a learning agent I thought it would run back to back, showing the different generations and their fitness as it progresses.

Would it be possible if anyone could show or point me in the right direction to get one of the learning agents to run, showing the fitness after each generation (or a certain number of generations). This way, I can play around with the agent to try and improve the rate at which the fitness increases with each evolution. Being able to see the agents later generations fitness would be sufficient enough for me to play around with and hopefully improve on.

Thanks in advance,

Jamie

Erek Speed

unread,
Apr 4, 2013, 8:52:13 PM4/4/13
to mariocom...@googlegroups.com
Did you get your code from the website or the repository?

I've not been tracking changes to the codebase closely in the last year but here's an example of a learning agent I wrote back then which might show how it works if it hasn't changed tons.  Sometimes the examples don't keep up with changes to the benchmark.



2013/4/4 Jamie Hickman <jamie_h...@hotmail.com>

--
 
---
You received this message because you are subscribed to the Google Groups "Mario Competition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mariocompetiti...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Erek Speed

unread,
Apr 4, 2013, 8:58:20 PM4/4/13
to mariocom...@googlegroups.com
Also, instead of Play you should use src/ch/idsia/scenarios/champ/LearningTrack.java

for learning agents.


2013/4/4 Erek Speed <meli...@gmail.com>
Message has been deleted

Jamie Hickman

unread,
Apr 4, 2013, 9:03:39 PM4/4/13
to mariocom...@googlegroups.com
Thanks for the quick reply, much appreciated.

I downloaded the source package from http://www.marioai.org/gameplay-track/getting-started.

I have tried using the LearningTrack.java but got this error:
Exception in thread "main" java.lang.ClassCastException: ch.idsia.agents.learning.SimpleMLPAgent cannot be cast to ch.idsia.agents.LearningAgent
at ch.idsia.scenarios.champ.LearningTrack.main(LearningTrack.java:168)
Java Result: 1

Jamie Hickman

unread,
Apr 4, 2013, 9:16:12 PM4/4/13
to mariocom...@googlegroups.com
I have downloaded your example and got it running with the LearningTrack.java but it still only does the one run through of the agent. After running it, it takes a while before the visualization appears and shows the agent running. Is this because it is playing the final evolution of the agent? If so, is there a way to see the agent evolving through the generations, either through visual or just via the output? What I want to be able to do is compare the different fitness through the generations to see how much of an improvement it makes, if at all.

Thanks,

Jamie

Erek Speed

unread,
Apr 4, 2013, 9:25:17 PM4/4/13
to mariocom...@googlegroups.com
Yeah, SimpleMLPAgent isn't actually a learning agent but is meant to be used in conjunction with another agent.   src/ch/idsia/agents/MLPESLearningAgent.java is the one that they use by default and you can play with it.

For seeing more fine grained detail, there are several things you can do.  In ErekSpeedCuckooAgent you can uncomment out these lines to see intermediate data.

if ((genCount % 100) == 0) {
//System.out.println("Generation:" + genCount);
//System.out.println("best:" + nests.get(n - 1).getFitness());
}


Your version may be different but the idea is to set visualization to true.  The current version does it after evolution has finished.

You can also put some counters in learningTrack so that it only visualizes every so often like how I print out information every so often in my agent.

If you poke around you'll see many different ways to collect and display information.  You can also save and replay (at least last I checked).  Which can let you do a lot of testing and then only look at ones with interesting numbers.



2013/4/4 Jamie Hickman <jamie_h...@hotmail.com>

Jamie Hickman

unread,
Apr 4, 2013, 9:36:41 PM4/4/13
to mariocom...@googlegroups.com
That is absolutely brilliant. Thank you so much, that is exactly what I was looking for, I am extremely grateful!

Mike Reddy

unread,
Apr 5, 2013, 9:07:19 AM4/5/13
to <mariocompetition@googlegroups.com>
Jamie is one of my students. Thank you for giving him pointers. I'm sure he will give you due credit in his write up :-)

DoctorMike

Erek Speed

unread,
Apr 5, 2013, 8:45:10 PM4/5/13
to mariocom...@googlegroups.com
It's no problem.  I spent a lot a time in this code base so I was happy to help.


2013/4/5 Mike Reddy <Mike....@newport.ac.uk>
Jamie is one of my students. Thank you for giving him pointers. I'm sure he will give you due credit in his write up :-)

DoctorMike
Reply all
Reply to author
Forward
0 new messages