Re: [Cleveland-AI-ML-support-group] How to get started with Python

From: Joe
Sent on: Saturday, September 3, 2011 4:53 PM
Hello all,
 Here's how to get started with the books python AI framework. The code is based on the books pseudo code.

Install python: http://www.python.org/getit/
Download the code: http://aima-python.googlecode.com/files/aima-python.2007.06.15.zip
Download the data: http://aima-data.googlecode.com/files/aima-data.2008.08.24.zip
Copy the below code into the file testai.py and run: python testai.py
experiment: http://docs.python.org/tutorial/

import sys
import agents

a=agents.ReflexVacuumAgent()
a.program
a.program((1, 'Clean'))
a.program((2, 'Clean'))

e = agents.TrivialVacuumEnvironment()
e.add_object(agents.TraceAgent(agents.ModelBasedVacuumAgent()))
e.run(2)

output:
# python testai.py
<ModelBasedVacuumAgent> perceives ((0, 0), 'Dirty') and does Suck
<ModelBasedVacuumAgent> perceives ((0, 0), 'Clean') and does Right
 



Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy