rm2k3ru6ru6 / aima-python

Automatically exported from code.google.com/p/aima-python
0 stars 0 forks source link

search algorithms outside classes ? #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi,
I'm currently trying to code algorithms provided in AIMA, but I don't 
understand why the Agent class isn't used in chapter 3 and 4, where agent 
programs are implemented as functions outside classes, and not as Agent's 
methods.
For instance, instead of "def SimpleReflexAgentProgram(rules, 
interpret_input):", why not 
class SimpleReflexAgent(Agent):
     def __init__(self, rules):
     ...      
         def simple_reflex_agent_program(percept):
             ...
         Agent.__init__(self, simple_reflex_agent_program)

I guess there's a good reason for that, because previous versions of the code 
were actually doing that. Could someone please explain to me ?

Original issue reported on code.google.com by tournev...@gmail.com on 19 Jul 2012 at 12:23