metaheuristic_designer.reporters package¶
Submodules¶
metaheuristic_designer.reporters.create_reporter module¶
Factory function for reporter objects.
- create_reporter(reporter_name: str, **kwargs) Reporter[source]¶
Instantiate a reporter by name.
- Parameters:
reporter_name (str) – One of
"silent","tqdm", or"verbose".**kwargs – Forwarded to the reporter constructor.
- Returns:
A concrete reporter instance.
- Return type:
- Raises:
ValueError – If reporter_name is not recognized.
metaheuristic_designer.reporters.silent_reporter module¶
Silent reporter that produces no output during a run.
- class SilentReporter[source]¶
Bases:
ReporterReporter that produces no output.
All logging methods are no-ops. Useful for running experiments without visual clutter.
- log_init(algorithm: Algorithm)[source]¶
Called once, before the main optimization loop starts.
- Parameters:
algorithm (Algorithm) – The algorithm that is about to run.
metaheuristic_designer.reporters.tqdm_reporter module¶
Reporter that shows a tqdm progress bar during optimization.
- class TQDMReporter(resolution: int = 1000, **kwargs)[source]¶
Bases:
ReporterReporter that displays a tqdm progress bar.
- Parameters:
resolution (int, optional) – Number of ticks in the progress bar (default 1000). Higher values give smoother updates.
metaheuristic_designer.reporters.verbose_reporter module¶
Reporter that prints a text summary at regular intervals.
Module contents¶
Built-in reporter implementations (silent, tqdm, verbose) and the factory.
- class Reporter[source]¶
Bases:
ABCAbstract interface for progress reporters.
A reporter is notified at three key moments of an optimization run: initialization, after each generation, and at completion. Implementations can display progress bars, log messages, update dashboards, etc.
- abstract log_init(algorithm: Algorithm)[source]¶
Called once, before the main optimization loop starts.
- Parameters:
algorithm (Algorithm) – The algorithm that is about to run.
- create_reporter(reporter_name: str, **kwargs) Reporter[source]¶
Instantiate a reporter by name.
- Parameters:
reporter_name (str) – One of
"silent","tqdm", or"verbose".**kwargs – Forwarded to the reporter constructor.
- Returns:
A concrete reporter instance.
- Return type:
- Raises:
ValueError – If reporter_name is not recognized.
- class SilentReporter[source]¶
Bases:
ReporterReporter that produces no output.
All logging methods are no-ops. Useful for running experiments without visual clutter.
- log_init(algorithm: Algorithm)[source]¶
Called once, before the main optimization loop starts.
- Parameters:
algorithm (Algorithm) – The algorithm that is about to run.
- class TQDMReporter(resolution: int = 1000, **kwargs)[source]¶
Bases:
ReporterReporter that displays a tqdm progress bar.
- Parameters:
resolution (int, optional) – Number of ticks in the progress bar (default 1000). Higher values give smoother updates.