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
orfinished()
.- 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.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
ifrun()
has started to run (it can be running or not).- Parameters
None
- Returns
A
bool
.
See also
- 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
ifrun()
is in the process of running andFalse
if it is not.
See also
- 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 iftimed_out()
,finished()
, ordead()
.- 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
.