pyanno4rt.optimization.solvers

Solvers module.


This module aims to provide methods and classes for wrapping the local and global solution algorithms from the integrated optimization packages.

Subpackages

Overview

Classes

ProxminSolver

Proxmin wrapper class.

Pyanno4rtSolver

Internal wrapper class.

PymooSolver

Pymoo wrapper class.

PyPop7Solver

PyPop7 wrapper class.

SciPySolver

SciPy wrapper class.

Attributes

solver_map

-

Classes

class pyanno4rt.optimization.solvers.ProxminSolver(number_of_variables, number_of_constraints, problem_instance, lower_variable_bounds, upper_variable_bounds, lower_constraint_bounds, upper_constraint_bounds, algorithm, initial_fluence, max_iter, tolerance)[source]

Proxmin wrapper class.

This class serves as a wrapper for the proximal optimization algorithms from the Proxmin solver. It takes the problem structure, configures the selected algorithm, and defines the method to run the solver.

Parameters:
  • number_of_variables (int) – Number of decision variables.

  • number_of_constraints (int) – Number of constraints.

  • problem_instance (object of class LexicographicOptimization WeightedSumOptimization) – The object representing the optimization problem.

  • lower_variable_bounds (list) – Lower bounds on the decision variables.

  • upper_variable_bounds (list) – Upper bounds on the decision variables.

  • lower_constraint_bounds (list) – Lower bounds on the constraints.

  • upper_constraint_bounds (list) – Upper bounds on the constraints.

  • algorithm (str) – Label for the solution algorithm.

  • initial_fluence (ndarray) – Initial fluence vector.

  • max_iter (int) – Maximum number of iterations.

  • tolerance (float)

  • value. (Precision goal for the objective function)

fun

Minimization function from the Proxmin library.

Type:

callable

arguments

Dictionary with the function arguments.

Type:

dict

Overview

Methods

callback(X, it, objective)

Log the intermediate results after each iteration.

run(initial_fluence)

Run the Proxmin solver.

Members

callback(X, it, objective)[source]

Log the intermediate results after each iteration.

Parameters:
  • X (ndarray) – Optimal point of the current iteration.

  • it (int) – Iteration counter.

  • fun (callable) – Objective value function.

run(initial_fluence)[source]

Run the Proxmin solver.

Parameters:

initial_fluence (ndarray) – Initial fluence vector.

Returns:

  • ndarray – Optimized fluence vector.

  • str – Description for the cause of termination.

class pyanno4rt.optimization.solvers.Pyanno4rtSolver(number_of_variables, number_of_constraints, problem_instance, lower_variable_bounds, upper_variable_bounds, lower_constraint_bounds, upper_constraint_bounds, algorithm, initial_fluence, max_iter, tolerance)[source]

Internal wrapper class.

This class serves as a wrapper for the internal optimization algorithms. It takes the problem structure, configures the selected algorithm, and defines the method to run the solver.

Parameters:
  • number_of_variables (int) – Number of decision variables.

  • number_of_constraints (int) – Number of constraints.

  • problem_instance (object of class LexicographicOptimization WeightedSumOptimization) – The object representing the optimization problem.

  • lower_variable_bounds (list) – Lower bounds on the decision variables.

  • upper_variable_bounds (list) – Upper bounds on the decision variables.

  • lower_constraint_bounds (list) – Lower bounds on the constraints.

  • upper_constraint_bounds (list) – Upper bounds on the constraints.

  • algorithm (str) – Label for the solution algorithm.

  • initial_fluence (ndarray) – Initial fluence vector.

  • max_iter (int) – Maximum number of iterations.

  • tolerance (float) – Precision goal for the objective function value.

fun

Minimization function from the pyanno4rt library.

Type:

callable

arguments

Dictionary with the function arguments.

Type:

dict

Overview

Methods

run(initial_fluence)

Run the pyanno4rt solver.

Members

run(initial_fluence)[source]

Run the pyanno4rt solver.

Parameters:

initial_fluence (ndarray) – Initial fluence vector.

Returns:

  • ndarray – Optimized fluence vector.

  • str – Description for the cause of termination.

class pyanno4rt.optimization.solvers.PymooSolver(number_of_variables, number_of_constraints, problem_instance, lower_variable_bounds, upper_variable_bounds, lower_constraint_bounds, upper_constraint_bounds, algorithm, initial_fluence, max_iter, tolerance)[source]

Pymoo wrapper class.

This class serves as a wrapper for the multi-objective (Pareto) optimization algorithms from the Pymoo solver. It takes the problem structure, configures the selected algorithm, and defines the method to run the solver.

Parameters:
  • number_of_variables (int) – Number of decision variables.

  • number_of_constraints (int) – Number of constraints.

  • problem_instance (object of class ParetoOptimization The object representing the (Pareto) optimization problem.)

  • lower_variable_bounds (list) – Lower bounds on the decision variables.

  • upper_variable_bounds (list) – Upper bounds on the decision variables.

  • lower_constraint_bounds (list) – Lower bounds on the constraints.

  • upper_constraint_bounds (list) – Upper bounds on the constraints.

  • algorithm (str) – Label for the solution algorithm.

  • initial_fluence (ndarray) – Initial fluence vector.

  • max_iter (int) – Maximum number of iterations.

  • tolerance (float) – Precision goal for the objective function value.

fun

Minimization function from the Pymoo library.

Type:

callable

algorithm_object

The object representing the solution algorithm.

Type:

object of class from pymoo.algorithms

problem

The object representing the Pymoo-compatible structure of the multi-objective (Pareto) optimization problem.

Type:

object of class from pymoo.core.problem

termination

The object representing the termination criterion.

Type:

object of class from pymoo.termination

Overview

Methods

run(_)

Run the Pymoo solver.

Members

run(_)[source]

Run the Pymoo solver.

Parameters:

initial_fluence (ndarray) – Initial fluence vector.

Returns:

  • ndarray – Optimized (Pareto) set of fluence vectors.

  • str – Description for the cause of termination.

class pyanno4rt.optimization.solvers.PyPop7Solver(number_of_variables, number_of_constraints, problem_instance, lower_variable_bounds, upper_variable_bounds, lower_constraint_bounds, upper_constraint_bounds, algorithm, initial_fluence, max_iter, tolerance)[source]

PyPop7 wrapper class.

This class serves as a wrapper for the population-based optimization algorithms from the PyPop7 solver. It takes the problem structure, configures the selected algorithm, and defines the method to run the solver.

Parameters:
  • number_of_variables (int) – Number of decision variables.

  • number_of_constraints (int) – Number of constraints.

  • problem_instance (object of class LexicographicOptimization WeightedSumOptimization) – The object representing the optimization problem.

  • lower_variable_bounds (list) – Lower bounds on the decision variables.

  • upper_variable_bounds (list) – Upper bounds on the decision variables.

  • lower_constraint_bounds (list) – Lower bounds on the constraints.

  • upper_constraint_bounds (list) – Upper bounds on the constraints.

  • algorithm (str) – Label for the solution algorithm.

  • initial_fluence (ndarray) – Initial fluence vector.

  • max_iter (int) – Maximum number of iterations.

  • tolerance (float) – Precision goal for the objective function value.

fun

The object representing the optimization algorithm.

Type:

object

arguments

Dictionary with the function arguments.

Type:

dict

Overview

Methods

run(initial_fluence)

Run the PyPop7 solver.

Members

run(initial_fluence)[source]

Run the PyPop7 solver.

Parameters:

initial_fluence (ndarray) – Initial fluence vector.

Returns:

  • ndarray – Optimized fluence vector.

  • str – Description for the cause of termination.

class pyanno4rt.optimization.solvers.SciPySolver(number_of_variables, number_of_constraints, problem_instance, lower_variable_bounds, upper_variable_bounds, lower_constraint_bounds, upper_constraint_bounds, algorithm, initial_fluence, max_iter, tolerance)[source]

SciPy wrapper class.

This class serves as a wrapper for the local optimization algorithms from the SciPy solver. It takes the problem structure, configures the selected algorithm, and defines the method to run the solver.

Parameters:
  • number_of_variables (int) – Number of decision variables.

  • number_of_constraints (int) – Number of constraints.

  • problem_instance (object of class LexicographicOptimization WeightedSumOptimization) – The object representing the optimization problem.

  • lower_variable_bounds (list) – Lower bounds on the decision variables.

  • upper_variable_bounds (list) – Upper bounds on the decision variables.

  • lower_constraint_bounds (list) – Lower bounds on the constraints.

  • upper_constraint_bounds (list) – Upper bounds on the constraints.

  • algorithm (str) – Label for the solution algorithm.

  • initial_fluence (ndarray) – Initial fluence vector.

  • max_iter (int) – Maximum number of iterations.

  • tolerance (float) – Precision goal for the objective function value.

fun

Minimization function from the SciPy library.

Type:

callable

arguments

Dictionary with the function arguments.

Type:

dict

counter

Counter for the iterations.

Type:

int

Overview

Methods

callback(intermediate_result)

Log the intermediate results after each iteration.

run(initial_fluence)

Run the SciPy solver.

Members

callback(intermediate_result)[source]

Log the intermediate results after each iteration.

Parameters:

intermediate_result (dict) – Dictionary with the intermediate results of the current iteration.

run(initial_fluence)[source]

Run the SciPy solver.

Parameters:

initial_fluence (ndarray) – Initial fluence vector.

Returns:

  • ndarray – Optimized fluence vector.

  • str – Description for the cause of termination.

Attributes

pyanno4rt.optimization.solvers.solver_map