pystra.decision.ddo.DDO#

Use it: User guide · Worked example · Theory

class DDO(*, study, criterion, objective=None)[source]#

Bases: object

Evaluate a decision context with an objective and acceptability criterion.

Construct directly from the three pieces:

ddo = DDO(
    study=study,
    objective=CostBenefitModel(...),
    criterion=LQI.from_country(...),
)

Construction is keyword-only by design: study, objective and criterion are easy to transpose positionally, which would silently misassign them. run() evaluates every alternative and caches the table; optimize() returns the best feasible alternative and economic_optimum() the unconstrained economic best.

Methods

economic_optimum

Return the alternative with the largest objective, ignoring feasibility.

feasible_results

Return evaluated alternatives satisfying the criterion.

optimize

Return the feasible alternative with the largest objective value.

plot

Plot results from the most recent run.

run

Evaluate every alternative; a failed rerun clears the previous table.

summary

Return the key decision points as a small labeled table.

property results: DataFrame | None#

Independent table from the last completed run, or None.

run()[source]#

Evaluate every alternative; a failed rerun clears the previous table.

Return type:

DataFrame

economic_optimum()[source]#

Return the alternative with the largest objective, ignoring feasibility.

Return type:

Series

feasible_results()[source]#

Return evaluated alternatives satisfying the criterion.

Return type:

DataFrame

optimize()[source]#

Return the feasible alternative with the largest objective value.

Return type:

Series

summary()[source]#

Return the key decision points as a small labeled table.

One row for the unconstrained economic optimum and, when the criterion admits one, a second for the best feasible alternative. Columns are the design variable, pf, beta (when present), the objective, and the criterion’s feasibility flag. This is the table a designer reads off a study, without rebuilding it row by row.

Return type:

DataFrame

plot(design=None, quantities=None, **kwargs)[source]#

Plot results from the most recent run.

Return type:

tuple[Figure, ndarray]