Python Project to Demonstrate Which Type of Python
Robot Can Most Efficiently Clean A Tiled Floor
Links
to Python Project to demonstrate how different python
robots can more efficiently clean a graphic of a
tiled floor.
Python Project to demonstrate how different python
robots can more efficiently clean a graphic of a
tiled floor
- We used a graphic of a tiled floor and various types
of Python made robots to demonstrate how best and
efficiently it could be cleaned by these.
- We used Python library packages Matplotlib (Pylab) and
NumPy for this assignment.
- In this assignment we coded a simulation to compare
how much time a group of Roomba like robots take to
clean a floor using 2 different strategies.
- The robot starts out in a random position in the room
and with a random direction of motion.
- A given floor had "N > 0" robots. The room was
rectangular. We had to keep track of which tiles of the
floor had already been cleaned by the robots.
- Each robot had a position "(x,y)" in the room and a
direction of motion "(0 <= dir < 360)" degrees.
- All robots moved at the same speed. Every time step,
a robot moves in its direction by speed "s" units. If a
robot detects it will hit a wall within the time step,
that time step is instead spent picking a new direction
at random.
- We did not put all the robots methods in one class,
since we also used alternate moving strategy robots that
used the same robot interface otherwise.
- In each trial, the objective is to determine how many
time steps on average are needed before a fraction of
the room has been cleaned.
- The professors provided us with some animation
software so we could more easy with visualizations debug
our code while our robots cleaned the room. However, it
slows down running your code.
- We tried out robots that change direction only when
they hit walls, and other robots that randomly change
direction every time step.
- Using Pylab, we plotted the percentage of room that a
robot cleans, time it takes 1-10 robots to clean 70% of
a room, percentage of a room that 1-10 robots clean,
time for robots to clean varying percentages of a room,
and area of a room that 1-10 robots clean, and similarly
these statistics for various sized rooms.