freneticlib.stopcriteria.counter

Module Contents

Classes

CountingStop

A concrete .StopCriterion based on execution counts.

class freneticlib.stopcriteria.counter.CountingStop(n_total, n_random, count_invalid=False)[source]

Bases: freneticlib.stopcriteria.abstract.StopCriterion

A concrete .StopCriterion based on execution counts.

Parameters:
  • n_total (int) – How many total simulations to allow.

  • n_random (int) – How many simulations to do before the random phase ends.

  • count_invalid (bool) – Whether invalid roads (``test[“outcome”] = Outcome.INVALID ``) that have not been simulated should also be counted towards the budget or ignored.

property is_over: bool

Returns: (bool): States whether there is any total execution budget left or not.

property is_random_phase: bool

Returns: (bool): States whether there is any random budget is still available.

exec_count = 0

Keeps track of the number of executions.

execute_test(test: freneticlib.core.core.TestIndividual)[source]

Inform the stop criterion that a test has been executed. Increases exec_count, but only if self.count_invalid is True

and the test["outcome"] is not Outcome.INVALID.

Parameters:

test (TestIndividual) – The test that has been executed.