GeneThello Home

net.sf.genethello.brain
Class TimeManagement

java.lang.Object
  extended by net.sf.genethello.brain.TimeManagement

public class TimeManagement
extends java.lang.Object

Class to manage thinking time based on remaining time quota and normal distribution along the step.

Author:
praz

Constructor Summary
TimeManagement(long timeQuota)
          Creates time management with thinking time quota.
 
Method Summary
 void cancelTimer()
          Cancels stopping timer upon thinking completion.
 void scheduleTimer(java.util.TimerTask task, int step)
          Executes timer task to stop thinking process upon time up.
 boolean timesUp(long l)
          Marks time is up if remaining step time is considered not enough.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeManagement

public TimeManagement(long timeQuota)
Creates time management with thinking time quota.

Parameters:
timeQuota - quota of thinking time (in ms)
Method Detail

scheduleTimer

public void scheduleTimer(java.util.TimerTask task,
                          int step)
Executes timer task to stop thinking process upon time up.

Parameters:
task - timer task to execute
step - current step

cancelTimer

public void cancelTimer()
Cancels stopping timer upon thinking completion.


timesUp

public boolean timesUp(long l)
Marks time is up if remaining step time is considered not enough.

Parameters:
l - total thinking time of previous depth
Returns:
time's up or not

GeneThello Home

Get GeneThello: Genetic Othello at SourceForge.net. Fast, secure and Free Open Source software downloads