Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

Hi, I'm on ps6. I've written the RunSimulation() method, but I'm not getting anywhere near close the number of clock cycles as they get in the handout ( I get ~40 vs their 150). here is my code. Sorry it's a bit messy.

MIT 6.00 Intro Computer Science (OCW)
I got my questions answered at in under 10 minutes. Go to now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Join Brainly to access

this expert answer


To see the expert answer you'll need to create a free account at Brainly

i'll comment on all i see: -do lines 70 and 73 work? -what does line 94 do? - you should delete all those 'raise NotImplementedError' lines -108 thru 111; you don't need the if/else just 'return self.tile in self.cleaned' -153 thru 156 ditto -259 thru 265; what if the second attempt hits a wall? - you might be cleaning tiles that aren't in the room -line 307; bots is a list just iterate over it -> for bot in bots: -311/312; the built-in function sum() takes an iterator -> time_sum = sum(times)
Hi, Thanks for the help. Corrected most of the points you raised. Except -259 thru 265 I'm assuming changing direction takes a time-step. I guess up to 75% of the possible new directions can still lead to hitting a wall. maybe ill change that. At the moment I'm getting well above what the brief quotes for times. Swings and round abouts.
Ok, deleted last comment as it was wrong, must have mistaken which shell was running the solution and my code. Turned out I needed to treat the percentage done as a float. Not sure why that made a difference

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

I misunderstood your op - i thought your were getting less, faster times integer division in 2.x --> truncates the fractional part of the results
no you understood right. it became longer times because when i calculated the percent done it was always 0 except when all tiles were done, 1.

Not the answer you are looking for?

Search for more explanations.

Ask your own question