|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Timings
The timings ("Speed"). Is that in system time or real time?
It largely makes a different if you're outputting stuff, since the apache process (or IIS thread) will block waiting to shift data out. Personally, I'd prefer it in system time, since that would test the speed of the algorithm more precisely. On a vaguely unrelated thread, how fast are people managing the games, and what scores are people actually getting? Be nice to know what I'm aiming for. :-) dave at clues.ltd.uk |
|
#2
|
|||
|
|||
|
RE: Timings
Quote from the rules:
Quote:
I will add code that will capture the start and stop time for your code. I will only capture the stop and start time of the actual play time. I.e., the time it takes to come up with a solution. If you are displaying output during the time you are coming up with the solution, then it will be included in the time. I recommend holding off the display until after you come up with a solution.... |
|
#3
|
|||
|
|||
|
RE: Timings
Ah, yes, I think you misread my question, though, so let me put it a different way.
Will you be using getrusage() or microtime()? And while I've your attention, by "solution", does that mean there will actually be a way to complete it entirely? And will you be using multiple runs with different decks or anything? |
|
#4
|
|||
|
|||
|
RE: Timings
I will be using microtime(). Now while some may disagree with this, I don't think it is an issue which way I go. Remember, all scripts are on a level playing field. They will all be judged by the same criteria on the same machines etc.
Yes, I will use multiple decks and multiple runs per a deck. By solution I mean what you come up with. By no means can every deck be completely solved... |
|
#5
|
|||
|
|||
|
RE: Timings
Okay, thanks for the clarification. I was hoping to cheat by using sub-processes, but now I'll just have to use time-travel. More complex, but I'll manage somehow.
Having reread your previous answer, though, another question. Is dealing, setup, and initialization of lookup gadgetry counted in your definition of "playing"? |
|
#6
|
|||
|
|||
|
RE: Timings
Quote:
i solve the posted deck.txt in 0.13 seconds with a score of 690. (G4/667; OSX) but theres no strategy behind it - the simplest tactic yields the best result with this deck. i wonder if there is a strategy (wich always leads to good results) at all. the only way to get the best result (everytime) is to store the game at each decision point, and play all possible games (you dont have to play all, but lots of) i think this is allowed according to the rules... any other way of coding would make the results highly dependent on the used decks (in this case 4 decks wont be enough to get a fair result) i am not a native speaker, hope you get what i meant ;-) i |
|
#7
|
|||
|
|||
|
RE: deck.txt
Mine completes in 25 milliseconds but has very little "intelligence" - at most games it'll do a very good job, but it doesn't think ahead.
|
|
#8
|
|||
|
|||
|
RE: Timings
Hmmm... 25 milliseconds in elapsed time or actual processor time?
I've noticed a really wide variation between elapsed time (microtime()) and the processor time (getrusage()). Across 500 runs on random decks, I'm taking an average of about 30ms accoridng to getrusage (system and user time added), but closer to 600ms average according to microtime(). I'm not 100% convinced that the timings measured are going to be accurate enough if microtime() is used. Given that we're meant to be measuring the "playing" only, we're not overly keen on subjective time to begin with. The downside is that, on Linux anyway, there's a relatively high granularity on getrusage(), so we're more likely to go into the appearance tie-break. (And my output leans towards "functional", rather than "pretty".) |
![]() |
| Viewing: Codewalkers Forums > PHP Contests > Older Contests > Timings |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|