Vacuum World version 1e-6alpha ;) released

Discussion in 'Python' started by Brian Blais, Apr 3, 2006.

  1. Brian Blais

    Brian Blais Guest


    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 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

    Brian Blais, Apr 3, 2006
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vijay
  2. V Green
    V Green
    Feb 5, 2008
  3. PA Bear [MS MVP]
    PA Bear [MS MVP]
    Feb 5, 2008
  4. Hans-Peter Diettrich
    Hans-Peter Diettrich
    Aug 22, 2008
  5. Adolf Arch-Impersonator
    Adolf Arch-Impersonator
    May 20, 2013

Share This Page