Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Sainthood via Seniority Simulation

by pg (Canon)
on Nov 05, 2003 at 06:04 UTC ( #304638=note: print w/ replies, xml ) Need Help??


in reply to Sainthood via Seniority Simulation

The logic is a little bit off in the while loop ;-)

If during the day, you advance to the next level, number of votes you can cast for that day is still based on your previous day's level.

However in your script, you do $level = $level->{next} first, and then right the way started to use $level->{votes}, which is the number of votes for the new level.

Not much difference in terms of the final results, especially take all the rand() into consideration, but the simulation is not precise.


Comment on Re: Sainthood via Seniority Simulation
Select or Download Code
Re: Re: Sainthood via Seniority Simulation
by ysth (Canon) on Nov 05, 2003 at 06:20 UTC
    I'm not sure I understand you. Can you explain in code or pseudocode? My intent was that everything in the loop after the ++$day is events occurring during the course of a day. Before ++$day is events occurring at the end of a day. (This doesn't correctly model exactly when the level actually changes, but I think it does use fields based on the correct level everywhere.)

      Reason: bassplayer delete -- owner seems to want it removed

      For more information on this node visit: this

      People didn't seem to like my asking for further explanation :(. I still don't see the bug, though I see my loop is written in a rather confusing way :(. I'm trying to compare what I have with sauoq's version. The first difference I see is whether the day number is printed just before or just after incrementing, which is really a cosmetic issue. We also differ on if the "used all votes" bonus applies to monks; Voting/Experience System could be read either way. (update: monks(5) don't seem to get the bonus--updating my version now)

      my version:

      increment level if appropriate increment day add per-vote xp add login xp add all-votes-used xp repeat
      sauoq's version:
      increment day increment level if appropriate add login xp add per-vote xp add all-votes-used xp repeat

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://304638]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2014-08-22 14:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (158 votes), past polls