piglot.solver.multi_case_solver.MultiCaseSolver
- class MultiCaseSolver(cases: List[Case], parameters: ParameterSet, output_dir: str, tmp_dir: str, verbosity: str, parallel: int = 1)[source]
-
Base class for solvers with multiple cases.
Methods
Get the case class to use for this solver.
Get the parameters for a given hash.
Get the results for all cases for a given hash.
Get the responses from a given output field for all cases.
Get all output fields.
Get the responses from all output fields for a given case.
Prepare data for the optimisation.
Read the solver from the configuration dictionary.
Solve all cases for the given set of parameter values.
- abstract classmethod get_case_class() Type[Case][source]
Get the case class to use for this solver.
Returns
- Type[Case]
Case class to use for this solver.
- get_case_params(param_hash: str) Dict[str, float][source]
Get the parameters for a given hash.
Parameters
- param_hashstr
Hash of the case to load.
Returns
- Dict[str, float]
Parameters for this hash.
- get_case_results(param_hash: str) List[CaseResult][source]
Get the results for all cases for a given hash.
Parameters
- param_hashstr
Hash of the case to load.
Returns
- List[CaseResult]
Results for all cases.
- get_current_response() Dict[str, OutputResult]
Get the responses from a given output field for all cases.
Returns
- Dict[str, OutputResult]
Output responses.
- get_output_response(param_hash: str) Dict[str, OutputResult][source]
Get the responses from all output fields for a given case.
Parameters
- param_hashstr
Hash of the case to load.
Returns
- Dict[str, OutputResult]
Output responses.
- classmethod read(config: Dict[str, Any], parameters: ParameterSet, output_dir: str) T[source]
Read the solver from the configuration dictionary.
Parameters
- configDict[str, Any]
Configuration dictionary.
- parametersParameterSet
Parameter set for this problem.
- output_dirstr
Path to the output directory.
Returns
- T
Solver to use for this problem.
- solve(values: ndarray, concurrent: bool) Dict[str, OutputResult][source]
Solve all cases for the given set of parameter values.
Parameters
- valuesarray
Current parameters to evaluate.
- concurrentbool
Whether this run may be concurrent to another one (so use unique file names).
Returns
- Dict[str, OutputResult]
Evaluated results for each output field.