470,848 Members | 1,830 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,848 developers. It's quick & easy.

Vacuum World version 1e-6alpha ;) released


I am just learning Python, and my first somewhat significant project is now available at


What is it?

Vacuum World is a simple simulation environment used to introduce some concepts in
Artificial Intelligence (Norvig, 2002), but can also be used as a simple introduction
to a programming language. In this case, of course, it is in Python. You write
python scripts to control a vacuum cleaner in a simulated room of dirt and furniture,
trying to vacuum up as much dirt and get back home to turn off. I've used wax to
make a nice gui for running the simulator.

A sample agent might look like:

if IsDirt():

Some Questions:

As I was making this, I had a number of issues. I invite anyone who cares to look
at the code to give me feedback about anything from GUI development, to code
organization, or anything else. I have a few questions right off the bat:

1) how is code like this usually distributed? Does one make a setup.py to install it
somewhere, and are there certain files that should be in the distribution that I
don't have? Should it include a windows binary from py2exe too?

2) I had some problems getting the center panel to fit right. I'd like to have it so
that when I resize the board, that the window grows and shrinks to the right size,
down to a minimum size (so I can still see the menus). I could do this, using the
Fit() method, but I found at the smaller sizes the individual images in the panel
started to have large (and growing) spaces between them. I'd rather the whole board
be centered in the panel. I tried every combination of Pack() and Fit() and
expand=... and align=... , but couldn't get it to work.

3) what sorts of documentation are standard for this? is there a standard way of
formatting docstrings (and am I thinking correctly that docstrings are just the
quoted strings right after a function declaration?)?
I'm sure that I will have more, but answers to these questions will get me a long
way. Let me know what you think! Please be gentle, because this is really my first
somewhat significant python project, so there is probably some cruft from my Matlab
and C experience (stray semi-colons here and there, etc.)

Brian Blais


Apr 3 '06 #1
0 925

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Holger Marzen | last post: by
1 post views Thread by Dmitry Tkach | last post: by
1 post views Thread by Guillaume Houssay | last post: by
8 posts views Thread by Dave Smith | last post: by
2 posts views Thread by lnd | last post: by
6 posts views Thread by Alex | last post: by
9 posts views Thread by Aleksey Serba | last post: by
9 posts views Thread by Joseph Shraibman | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.