On PS11 Question 3, I keep getting slightly different room cleaning ties (on average) than the ones given in the PSet. The visualization looks correct. Is it possible the data given by the PSet is wrong?
I keep getting cleaning times slightly less than the ones given in the Pset. For instance for one robot and 5x5 room at 100% cleanliness, I get on average about 100 time ticks instead of 150 as given by the PSet. And for one robot, 10x10 room at 75% cleanliness, I get on average 150 time ticks instead of 190. I ran the visualization and it looks correct. Did anyone else get similar issues? By the way, my code is written such that the Roomba changes direction when it knows it will hit a wall in the next time step, not when it actually hits the wall. Dunno if that makes a difference.
For reference: def runSimulation(num_robots, speed, width, height, min_coverage, num_trials, robot_type, visualize): coverage_data = [] time_data = [] for trial in range(num_trials): anim = ps11_visualize.RobotVisualization(num_robots, width, height) room = RectangularRoom(width, height) cleanTiles = float(room.getNumCleanedTiles()) totalTiles = room.getNumTiles() trial_coverage = [] robot_roster = [] for i in range(num_robots): new_robot = robot_type(room,speed) robot_roster += [new_robot] while cleanTiles/totalTiles*100 < min_coverage: for robot in robot_roster: robot.updatePositionAndClean() cleanTiles = float(room.getNumCleanedTiles()) anim.update(room, robot_roster) trial_coverage += [cleanTiles/totalTiles*100] coverage_data += [trial_coverage] anim.done() time_data += [len(trial_coverage)] print numpy.mean(time_data) return coverage_data I added time_data to track the number of time ticks taken in each trial
i did these many moons ago and i also get results like @hotdogning
Join our real-time social learning platform and learn together with your friends!