hiroyukiterai / marioai

Automatically exported from code.google.com/p/marioai
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

evaluateSubmission in LearningEvaluation doesn't use learningAgent to run simulations #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.  In LearningEvaluation.java set your agent at line 106 in the "main" method.
2.  Run LearningEvaluation.
3.  Wait for the first level to finish.

What is the expected output? What do you see instead?
The expected output is to see your learned agent playing the level they 
learned.  Instead, the visualization shows the human keyboard agent.

What version of the product are you using? On what operating system?
Latest from Subversion. IntelliJ 9.0.3.  Windows 7 x64

Please provide any additional information below.

We pass in both a CmdLineOptions argument and a LearningAgent argument to 
evaluateSubmission, but what evaluateSubmission does with those arguments is a 
bit strange.  The key bit to notice is that cmdLineOptions does not have an 
agent set.

In evaluateSubmission, a ProgressTask task is made using the cmdLineOptions.  
This means the task has no agent except the default agent!  A similar problem 
occurs later with basicTask.

I think the best solution is to add the agent to the cmdLineOptions in 'main' 
and then in evaluateSumbission you can make the task as normal, and use 
cmdLineOptions.getAgent() for the agent, though the unsafe cast is annoying.

Original issue reported on code.google.com by melin...@gmail.com on 27 Oct 2010 at 3:37

GoogleCodeExporter commented 8 years ago
I think maybe you don't even need getAgent if you continue to pass in 
learningAgent to evaluateSubmission like you do now.

Original comment by melin...@gmail.com on 27 Oct 2010 at 3:38

GoogleCodeExporter commented 8 years ago
Here's my suggested patch which seems to be working:

Original comment by melin...@gmail.com on 27 Oct 2010 at 3:50

Attachments:

GoogleCodeExporter commented 8 years ago
Something's still wrong.  I'm investigating.

Original comment by melin...@gmail.com on 27 Oct 2010 at 4:22

GoogleCodeExporter commented 8 years ago
The thing that was still wrong was not actually wrong just different.  It seems 
like the LearningEvaluation is being moved to a new format so I'm not sure if 
various complaints hold too much water yet.

Original comment by melin...@gmail.com on 27 Oct 2010 at 9:32

GoogleCodeExporter commented 8 years ago
Thanks you for your response! Your patch was very useful! But problem solved in 
a different way.

Original comment by Nikolay....@gmail.com on 27 Oct 2010 at 12:05

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r613.

Original comment by Nikolay....@gmail.com on 27 Oct 2010 at 12:06