clabra / opennero

Automatically exported from code.google.com/p/opennero
Other
0 stars 0 forks source link

Q-learning in Maze does not work. #100

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run OpenNero
2. Select Maze, Q-learning (coarse or fine)
3. Click Start

What is the expected output? What do you see instead?

Expected to see search of maze - all other search options (e.g. A*) work 
correctly, showing full animation. For Q-learning nothing happens in graphic 
window and console shows repeating error message:

File "C:\OpenNERO-2011.11.11-win32\OpenNERO-2011.11
n32\Maze\agent.py", line 189, in act Q_old = 
self.predict(self.previous_observations, self.previous_action)
AttributeError: 'CustomRLAgent' object has no attribute 'previous_action'

What version of the product are you using? On what operating system?

I guess the version is 2011.11.11-win32. Running on Win7-64bit. Correct Python 
and WxPython versions are installed and I think Path must be set correctly 
because other OpenNero routines are working.

Please provide any additional information below.

Don't know much Python, but I naively tried to add a line "self.previous_action 
= None" to the __init__ of CustomRLAgent, but this just generates a new error.

Original issue reported on code.google.com by mwo...@gmail.com on 14 Nov 2011 at 3:38

GoogleCodeExporter commented 9 years ago
The underlying cause of this error actually occurs earlier:

{{{
(M) [python] Traceback (most recent call last):
  File "c:\opennero\build-of-trunk\dist\Release\Maze\agent.py", line 172, in start
    self.previous_action = self.get_epsilon_greedy(observations)
  File "c:\opennero\build-of-trunk\dist\Release\Maze\agent.py", line 154, in get_epsilon_greedy
    actions = self.get_possible_actions(observations)
  File "c:\opennero\build-of-trunk\dist\Release\Maze\agent.py", line 133, in get_possible_actions
    actions = range(aMin, aMax+1)
TypeError: range() integer end argument expected, got float.
}}}

Original comment by ikarpov on 14 Nov 2011 at 8:21

GoogleCodeExporter commented 9 years ago

Original comment by ikarpov on 14 Nov 2011 at 8:21

GoogleCodeExporter commented 9 years ago
r1387 addresses this issue

Original comment by ikarpov on 14 Nov 2011 at 8:22