piglot.objectives.response_objective.ResponseObjective
- class ResponseObjective(parameters: ParameterSet, solver: Solver, objectives: List[ResponseSingleObjective], output_dir: str, scalarisation: Scalarisation | None = None, stochastic: bool = False, composite: bool = False, full_composite: bool = True, transformers: Dict[str, ResponseTransformer] | None = None)[source]
Bases:
GenericObjectiveObjective for generic response-based objectives.
Methods
Get the objective history.
Plot the current best case.
Plot a given function call given the parameter hash
Plot the currently running function call
Post-process the responses from the solver.
Prepare the objective for optimisation.
Read the objective from a configuration dictionary.
- __call__(params: ndarray, concurrent: bool = False) ObjectiveResult
Objective computation for the outside world. Also handles output file writing.
Parameters
- paramsnp.ndarray
Set of parameters to evaluate the objective for.
- concurrentbool, optional
Whether this call may be concurrent to others, by default False.
Returns
- ObjectiveResult
Objective result.
- get_history() Dict[str, Dict[str, Any]]
Get the objective history.
Returns
- Dict[str, Dict[str, Any]]
Dictionary of objective history.
- plot_best() List[Figure]
Plot the current best case.
Returns
- List[Figure]
List of figures with the plot.
- plot_case(case_hash: str, options: Dict[str, Any] | None = None) List[Figure][source]
Plot a given function call given the parameter hash
Parameters
- case_hashstr, optional
Parameter hash for the case to plot
- optionsDict[str, Any], optional
Options to pass to the plotting function, by default None
Returns
- List[Figure]
List of figures with the plot
- plot_current() List[DynamicPlotter][source]
Plot the currently running function call
Returns
- List[DynamicPlotter]
List of instances of a updatable plots
- postproc_responses(responses: Dict[str, OutputResult]) Dict[str, OutputResult][source]
Post-process the responses from the solver.
Parameters
- responsesDict[str, OutputResult]
Raw responses from the solver.
Returns
- Dict[str, OutputResult]
Post-processed responses.
- abstract classmethod read(config: Dict[str, Any], parameters: ParameterSet, output_dir: str) T
Read the objective from a configuration dictionary.
Parameters
- configDict[str, Any]
Terms from the configuration dictionary.
- parametersParameterSet
Set of parameters for this problem.
- output_dirstr
Path to the output directory.
Returns
- Objective
Objective function to optimise.