Treatment Planning as a Convex Problem

Define PlanningProblem, interface between Case and solvers.

class problem.PlanningProblem[source]

Interface between Case and convex solvers.

Builds and solves specified treatment planning problem using fastest available solver, then extracts solution data and solver metadata (e.g., timing results) for use by clients of the PlanningProblem object (e.g., a Case).

solver_cvxpy

SolverCVXPY or NoneTypecvxpy-baed solver, if available.

solver_pogs

SolverOptkit or NoneType – POGS solver, if available.

solve(structures, run_output, slack=True, exact_constraints=False, **options)[source]

Run treatment plan optimization.

Parameters:
  • structures – Iterable collection of Structure objects with attached objective, constraint, and dose matrix information. Build convex model of treatment planning problem using these data.
  • run_output (RunOutput) – Container for saving solver results.
  • slack (bool, optional) – If True, build dose constraints with slack.
  • exact_constraints (bool, optional) – If True and at least one structure has a percentile-type dose constraint, execute the two-pass planning algorithm, using convex restrictions of the percentile constraints on the firstpass, and exact versions of the constraints on the second pass.
  • **options – Abitrary keyword arguments, passed through to PlanningProblem.solver.init_problem() and PlanningProblem.solver.build().
Returns:

Number of feasible solver runs performed: 0 if first pass infeasible, 1 if first pass feasible, 2 if two-pass method requested and both passes feasible.

Return type:

int

Raises:

ValueError – If no solvers avaialable.

solver

Get active solver (CVXPY or OPTKIT/POGS).