freneticlib.stopcriteria.timer

Module Contents

Classes

TimeStop

All timing is in seconds

class freneticlib.stopcriteria.timer.TimeStop(random_time: int, total_time: int)[source]

Bases: object

All timing is in seconds

Parameters:
  • random_time (int) – How many seconds of random search time to allow.

  • total_time (int) – How many seconds of total search time to allow.

property is_over: bool

Returns: (bool): States whether the search budget has been used up.

property is_random_phase: bool

Returns: (bool): States whether there is random search budget remaining.

property elapsed_time: float

Returns: (float): How much time has passed since starting the timer.

property remaining_time: float

Returns: (float): How much time there is left.

reset()[source]
execute_test(test)[source]

Inform the stop criterion that a test has been executed.

Does nothing.

__str__() str[source]
Returns:

Return a string containing Start, Elapsed and Remaining time.

Return type:

(str)