Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

lostminty Group Title

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). http://pastebin.com/kfF32kcp here is my code. Sorry it's a bit messy.

  • one year ago
  • one year ago

  • This Question is Closed
  1. bwCA Group Title
    Best Response
    You've already chosen the best response.
    Medals 3

    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)

    • one year ago
  2. lostminty Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    Hi, Thanks for the help. Corrected most of the points you raised. Except -259 thru 265 http://pastebin.com/G4Bqi8HX 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.

    • one year ago
  3. lostminty Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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

    • one year ago
  4. bwCA Group Title
    Best Response
    You've already chosen the best response.
    Medals 3

    I misunderstood your op - i thought your were getting less, faster times http://dpaste.com/1241974/ integer division in 2.x --> truncates the fractional part of the results

    • one year ago
  5. lostminty Group Title
    Best Response
    You've already chosen the best response.
    Medals 0

    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.

    • one year ago
    • Attachments:

See more questions >>>

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.