Difference between revisions of "Thread:User talk:Wompi/Skipped Turns ... what to know about?/reply (4)"

From Robowiki
Jump to navigation Jump to search
 
 
Line 1: Line 1:
 
So is this what we think should happen here?
 
So is this what we think should happen here?
* You call execute() on turn t. You've taken <math>turnTime * 3.5</math> since your last execute call started, so you need to skip 3 turns.
+
* You call execute() on turn t. You've taken <math>turnTime * 3.5</math> during your events processing and run loop for time t, so you need to skip 3 turns.
 
* Your turn t processes normally, execute() hangs while Robocode processes 3 more turns, events are fired to your bot for turn t+4, and control returns to the run loop with time t+4.
 
* Your turn t processes normally, execute() hangs while Robocode processes 3 more turns, events are fired to your bot for turn t+4, and control returns to the run loop with time t+4.
 
Alternatively, and this would explain the above output:
 
Alternatively, and this would explain the above output:
 
* Instead of execute() hanging while Robocode processes 3 more turns, your calls to execute() just do nothing for 3 turns, but your main loop still runs.
 
* Instead of execute() hanging while Robocode processes 3 more turns, your calls to execute() just do nothing for 3 turns, but your main loop still runs.
 
That would be unfortunate, since you might do significant processing in run() with no effect, and several iterations of run() might count against your next turn's time allotment, causing you to skip more turns.
 
That would be unfortunate, since you might do significant processing in run() with no effect, and several iterations of run() might count against your next turn's time allotment, causing you to skip more turns.

Latest revision as of 18:09, 11 June 2012

So is this what we think should happen here?

  • You call execute() on turn t. You've taken <math>turnTime * 3.5</math> during your events processing and run loop for time t, so you need to skip 3 turns.
  • Your turn t processes normally, execute() hangs while Robocode processes 3 more turns, events are fired to your bot for turn t+4, and control returns to the run loop with time t+4.

Alternatively, and this would explain the above output:

  • Instead of execute() hanging while Robocode processes 3 more turns, your calls to execute() just do nothing for 3 turns, but your main loop still runs.

That would be unfortunate, since you might do significant processing in run() with no effect, and several iterations of run() might count against your next turn's time allotment, causing you to skip more turns.