Loading ...
Sorry, an error occurred while loading the content.

Bug in the AIMA-Python files

Expand Messages
  • Antti
    The AIMA-Python project inspired me to study the Python code in the AIMA site Python files. It seems that I have discovered one bug in those Python files. (I
    Message 1 of 1 , Dec 16, 2011
    • 0 Attachment
      The AIMA-Python project inspired me to study the Python code in the
      AIMA site Python files. It seems that I have discovered one bug in
      those Python files. (I might even dedicate some programmer hours to
      the AIMA-Python project to contribute something for it.)

      In the file agents.py there are there the instructions to run the
      reflex agent in the vacuum world as follows:

      --------------------------------------

      __doc__ += """
      >>> a = ReflexVacuumAgent()
      >>> a.program((loc_A, 'Clean'))
      'Right'
      >>> a.program((loc_B, 'Clean'))
      'Left'
      >>> a.program((loc_A, 'Dirty'))
      'Suck'
      >>> a.program((loc_A, 'Dirty'))
      'Suck'

      --------------------------------------

      which will not run. The agents.py module first must be imported, and
      after that the names in the module must be qualified with the module
      name in order to be able to run them from the interactive mode.

      The instructions should read (this way they will actually work)

      --------------------------------------

      >>> import agents
      >>> a = agents.ReflexVacuumAgent()
      >>> a.program((agents.loc_A, 'Clean'))
      'Right'
      >>> a.program((agents.loc_B, 'Clean'))
      'Left'
      >>> a.program((agents.loc_A, 'Dirty'))
      'Suck'

      --------------------------------------


      Cheers, Antti J Ylikoski
      Helsinki, Finland, the E.U.
    Your message has been successfully submitted and would be delivered to recipients shortly.