Hybrid Computing
Hybrid computing fuses the available classical digital algorithms with the new possibilities introduced by analog computing!
Common Hybrid Computing Tasks
- class pyanabrid.base.hybrid.programs.recl.RunEvaluateReconfigureLoop(*args, **kwargs)
Bases:
BaseProgram
Run-Evaluate-Reconfigure-Loop Abstraction
This class implements the typical process flow of a run-evaluate-reconfigure-loop. Users should inherit this class and overwrite the following function to inject their specific code.
init_loop()
for one-time initialization codenext_configuration()
for configuring the next runrun_done()
for evaluating a completed runloop_done()
for final evaluation or cleanup code
- RUN_CONFIG: BaseRunConfig = None
- create_run()
- get_run_kwargs()
- init_loop(computer: AnalogComputer)
User-supplied function called before the loop is started.
Use this function to set user variables and constant computer configuration values. Acquire any necessary resources (like opening files).
- Parameters:
computer – A representation of the specific analog computer
- Returns:
None
- loop_done(runs: List[BaseRun])
User-supplied function called after the loop exits.
Use this to close any open resources (like files) and to do evaluation across multiple runs.
- Parameters:
runs – List of all executed runs.
- Returns:
None
- next_configuration(computer: AnalogComputer, previous_runs: List[BaseRun])
User-supplied function called before each run.
Use this function to set the configurations for the upcoming run. You can either modify the passed modules or access modules you ‘remembered’ in init_loop.
This function is also called for the first run, with previous_runs being an empty list.
- Parameters:
computer – A representation of the specific analog computer
previous_runs – List of previous runs
- Returns:
None
- run_done(run: BaseRun) bool
User-supplied function called after a run is completed.
Use this function to evaluate the results of the latest run. If the loop should be stopped after this run, return True.
- Parameters:
run – The just completed run
- Returns:
True if loop should be stopped, False to continue
- runs: List[BaseRun]
- async start()
Entrypoint for starting the Run-Evaluate-Reconfigure-Loop
This function is called automatically by the anabrid command line tool. You should not need to call it unless you manually start a loop.
- Returns:
None