Running and reporting

This page contains information about the methods of the Konieczny class related to running and reporting.

Konieczny.run(self: Konieczny) None

Run the algorithm until it finishes.

Parameters

None

Returns

None

Konieczny.run_for(self: Konieczny, t: datetime.timedelta) None

Run for a specified amount of time.

Parameters

t (datetime.timedelta) -- the time to run for.

Returns

None

Konieczny.run_until(self: Konieczny, func: Callable[], bool) None

Run until a nullary predicate returns True or finished().

Parameters

func (Callable[], bool) -- a function.

Returns

None

Konieczny.kill(self: Konieczny) None

Stop running the main algorithm (thread-safe).

Parameters

None

Returns

None.

Konieczny.dead(self: Konieczny) bool

Check if the runner is dead.

Parameters

None

Returns

A bool.

Konieczny.finished(self: Konieczny) bool

Check if the main algorithm implemented in this class has been run to completion or not.

Parameters

None

Returns

A bool.

Konieczny.started(self: Konieczny) bool

Check if run() has been called at least once before.

Returns True if run() has started to run (it can be running or not).

Parameters

None

Returns

A bool.

See also

finished().

Konieczny.report(self: Konieczny) bool

Check if it is time to report.

Parameters

None

Returns

A bool.

Konieczny.report_every(self: Konieczny, t: datetime.timedelta) None

Set the minimum elapsed time between reports.

Parameters

t (datetime.timedelta) -- the amount of time between reports.

Returns

None

Konieczny.report_why_we_stopped(self: Konieczny) None

Report why we stopped.

Parameters

None

Returns

None

Konieczny.running(self: Konieczny) bool

Check if currently running.

Parameters

None

Returns

True if run() is in the process of running and False if it is not.

See also

run().

Konieczny.timed_out(self: Konieczny) bool

Check if the main algorithm has or should timed out.

Parameters

None

Returns

A bool.

Konieczny.stopped(self: Konieczny) bool

Check if the main algorithm has or should stop.

This function can be used to check whether or not run() has been stopped for whatever reason. In other words, it checks if timed_out(), finished(), or dead().

Parameters

None

Returns

A bool.

Konieczny.stopped_by_predicate(self: Konieczny) bool

Check if the main algorithm was, or should be, stopped by the nullary predicate passed as first argument to run_until().

Parameters

None

Returns

A bool.