Documentation for pdopt.data
Module that contains all the data structures used within PDOPT.
Design Set objects
pdopt.data.DesignSpace
A class to represent a Design Space.
| Attributes: |
|
|---|
pdopt.data.DesignSpace.__init__(parameters, objectives, constraints)
Initialise the DesignSpace object.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DesignSpace.from_csv(csv_parameters, csv_responses)
classmethod
Helper function to initialise the DesignSpace object from .csv files. This is useful for running multiple cases without modifying the python scripts.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DesignSpace.from_pickle(filepath)
classmethod
Load a DesignSpace object from a pickle file.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DesignSpace.save_to_pickle(filepath)
Save a DesignSpace object as pickle file.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DesignSpace.get_exploration_results()
Construct a pandas DataFrame with the exploration results.
| Returns: |
|
|---|
pdopt.data.DesignSpace.get_optimum_results()
Construct a pandas DataFrame with the optimisation results.
| Returns: |
|
|---|
pdopt.data.DesignSpace.set_discard_status(set_id, status)
Set the discard status of a set.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DesignSpace.save_exploration_results(filepath)
Save exploration results as a .csv file
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DesignSpace.save_optimisation_results(filepath)
Save optimisation results as a .csv file
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DesignSpace.sample_from_set(set_id, n_samples, debug=False)
Sample design parameters contained within a set using LatinHypercube.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DesignSet
A class to represent a Design Set.
| Attributes: |
|
|---|
pdopt.data.DesignSet.__init__(input_parameter_levels, response_parameters)
Initialise the Design Set object.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DesignSet.get_discarded_status()
Get the discarded status of the set.
| Returns: |
|
|---|
pdopt.data.DesignSet.get_P()
Get the overall probability of the set.
| Returns: |
|
|---|
pdopt.data.DesignSet.get_response_P(response_id=None)
Returns the probability of a response or all of them.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DesignSet.set_responses_P(response_name, P_response)
Updates adds the probability of the response and updated the global probability.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DesignSet.set_as_discarded()
Set the set as discarded.
| Returns: |
|
|---|
pdopt.data.DesignSet.set_optimisation_problem(opt_problem)
Set the optimisation problem from the Optimisation library
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DesignSet.sample(n_samples, parameters_list, debug=False)
Sample designs within the set using Latin Hypercube
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DesignSet.get_optimum()
Get a pandas DataFrame with the Search phase results of this set.
| Returns: |
|
|---|
Input Parameter objects
pdopt.data.ContinousParameter
Bases: Parameter
A class to represent a Continous Parameter.
| Attributes: |
|
|---|
pdopt.data.ContinousParameter.get_bounds()
Returns a tuple with the continous parameter bounds
| Returns: |
|
|---|
pdopt.data.ContinousParameter.get_level_bounds(level)
Returns a tuple containing the bounds of the selected level.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.ContinousParameter.__init__(name, lb, ub, n_levels, uq_dist, uq_var_l, uq_var_u)
Initialise the Continous Parameter object.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.ContinousParameter.sample(n_samples, level=None)
Sample within the entire continuous parameter or in a level.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.ContinousParameter.ppf(quantile, x0)
Inverse cumulative function for obtaining random values around a reference point, given a quantile.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.DiscreteParameter
Bases: Parameter
A class to represent a discrete parameter.
| Attributes: |
|
|---|
pdopt.data.DiscreteParameter.get_n_levels()
Returns the number of levels of this parameter.
| Returns: |
|
|---|
Response objects
pdopt.data.Objective
Bases: Response
A class to represent an Objective.
| Attributes: |
|
|---|
pdopt.data.Objective.__init__(name, operand, min_requirement=None, p_sat=0.5)
Initialise the Objective object.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.Objective.get_requirement()
Get the inequality that defines the soft constraint, if present. Returns a tuple containing the operand and right-hand side value. Returns none if no soft constraint is present.
| Returns: |
|
|---|
pdopt.data.Objective.get_operand()
Get the multiplier required by the pymoo optimiser to perform maximisation.
| Returns: |
|
|---|
pdopt.data.Constraint
Bases: Response
A class to represent a Constraint.
| Attributes: |
|
|---|
pdopt.data.Constraint.__init__(name, operand, value, p_sat=0.5)
Initialise the Constraint object.
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.Constraint.get_constraint()
Get the inequality that defines the constraint. Returns a tuple containing the operand and the right-hand side value.
| Returns: |
|
|---|
Simulation model objects
pdopt.data.Model
A class to encapsulate the design model.
| Attributes: |
|
|---|
pdopt.data.Model.__init__(model_fun)
Initialise the design model. Model function has to be designed such that what it returns is the same as the response list example: model_fun(*args : list[float]) -> dict[str, float]
| Parameters: |
|
|---|
| Returns: |
|
|---|
pdopt.data.ExtendableModel
Model Object that can be extended and used by the library
pdopt.data.ExtendableModel.run(*args)
The run() method has to be overloaded with the evaluation function required to run the analysis. Input parameters must be a list in the order of the paramters passed to the DesignSpace object. Output must be a dictionary containing for keyword the names of the constraints and objectives as defined in the DesignSpace object.
| Parameters: |
|
|---|
| Returns: |
|
|---|