Iterations module¶
Describe the iterative process performed to find and optimized trajectory that satisfies the constraints.
- pyrotor.iterations.binary_search_best_trajectory(trajectory, i, step, verbose)¶
Perform a binary search amoung all the kappas in order to find the optimised trajectory that verifies constraints.
- Inputs:
- trajectory: Pyrotor instance
Trajectory to optimize with associated attributes; the object will be directly modified by reference
- i: int
Index of the kappa to use
- step: int
Size of the current split
- verbose: boolean
Display pr not the verbose
- pyrotor.iterations.compute_kappa_max(kappa_mean, opti_factor)¶
Compute the supposed possible maximum value of kappa.
- Inputs:
- kappa_mean: float
Mean of kappa
- opti_factor: float
Optimisation factor
- Output:
- kappa_max: float
Supposed possible maximum value of kappa
- pyrotor.iterations.compute_kappa_mean(evaluations_f, evaluations_g)¶
Compute the mean of kappa.
- Inputs:
- evaluations_f: list
Evaluations of f over reference coefficients
- evaluations_g: list
Evaluations of g over reference coefficients
- Output:
- kappa_mean: float
Mean of kappa
- pyrotor.iterations.get_kappa_boundaries(reference_coefficients, format_model, sigma_inverse, c_weight, opti_factor, extra_info)¶
Give the possible minumum and maximum supposed values of kappa.
Here the cost function is of the form f + kappa*g so kappa is chosen in such a way that kappa = opti_factor * mean f / mean g where opti_factor is chosen by the user.
The larger opti_factor is, the more important g is when optimising.
- Inputs:
- reference_coefficients: ndarray
Coefficients of reference trajectories
- format_model: list of arrays or sklearn model
Model of the cost; if list, the first element of the list is the the integrated linear part W and the second one the integrated quadratic part Q
- sigma_inverse: ndarray
Pseudoinverse of the covariance matrix of the reference coefficients
- c_weight: ndarray
Coefficients of a weighted trajectory
- opti_factor: float
Optimisation factor
- extra_info: dict
Contains independent_variable, basis, basis_features and basis_dimension dictionaries
- Outputs:
- kappa_min: float
Supposed possible minimum value of kappa; here set to 0
- kappa_max: float
Supposed possible maximum value of kappa
- pyrotor.iterations.iterate_through_kappas(trajectory, kappa_min, kappa_max, verbose)¶
Iterate through the different kappas in order to find the optimised trajectory that verifies constraints.
- Inputs:
- trajectory: Pyrotor instance
Trajectory to optimize with associated attributes; the object will be directly modified by reference
- kappa_min: float
Supposed minimum possible kappa
- kappa_max: float
Supposed maximum possible kappa
- verbose: boolean
Display or not the verbose