473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Vacuum World version 1e-6alpha ;) released

Hello,

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

http://web.bryant.edu/~bblais/python/vac.tgz

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:

Forward()
if IsDirt():
Vacuum()
Off()

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.)
thanks,

Brian Blais

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

bb****@bryant.edu
http://web.bryant.edu/~bblais
Apr 3 '06 #1
0 1009

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Holger Marzen | last post by:
Hi all, the docs are not clear for me. If I want (in version 7.1.x, 7.2.x) to help the analyzer AND free unused space do I have to do a vacuum vacuum analyze or is a
1
by: Dmitry Tkach | last post by:
Hi, everybody! I am getting a weird failure, trying to vacuum a table in 7.3 - it says "ERROR: Index pg_toast_89407_index is not a btree". Does it ring a bell to anyone? Any ideas what's wrong?...
10
by: Stephen | last post by:
Hello, Is it normal for plain VACUUM on large table to degrade performance by over 9 times? My database becomes unusable when VACUUM runs. From reading newsgroups, I thought VACUUM should only...
1
by: Guillaume Houssay | last post by:
I am using a 7.3.4. just simple questions ;=) 1.when I launch a vacuum verbose analyze on my database. Does it re-cretae all the indexes of each table ? 2.In addition to the vacuum, do I...
8
by: Dave Smith | last post by:
I am running 7.2 and when doing a vacuum I am getting the following error.... ERROR: Cannot insert a duplicate key into unique index pg_statistic_relid_att_index Where do I start to fix...
2
by: lnd | last post by:
Any comments on multi-versioning problem: As far as I understand from PG documentation, *CURRENTLY* VACUUM must be run regulary, otherwise: -Q. database will grow as fast as there are many DML...
6
by: Alex | last post by:
Hi, just a few questions on the Vaccum I run a vacuum analyze on the database every night as part of a maintenance job. During the day I have a job that loads 30-70,000 records into two...
2
by: Russell Smith | last post by:
Postgresql 7.4.5 The following VACUUMs were run within a couple of minutes of each other completing. This table concerned is a table that has not been changed in a long time. (a month) There...
9
by: Aleksey Serba | last post by:
Hello! I have 24/7 production server under high load. I need to perform vacuum full on several tables to recover disk space / memory usage frequently ( the server must be online during vacuum...
9
by: Joseph Shraibman | last post by:
I have a table that is usually really small (currently 316 rows) but goes through spasams of updates in a small time window. Therefore I have a vacuum full run every hour on this table. Last...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.