evaluate_baseline
site.SiteProblem.evaluate_baseline(
site_names=None,
site_indices=None,
objective='p_median',
weights=None,
threshold_for_coverage=None,
beyond_thresholds=None,
)Evaluate the current (“do-nothing”) network as a one-solution SiteSolutionSet, for use as a baseline with SolutionComparator.population_impact_summary() or solve(baseline=...).
A thin, ergonomic wrapper around evaluate_single_solution_single_objective() – it wraps that single result in a one-row solution_df so the baseline can be passed around and compared using the same SiteSolutionSet API as any solved solution (site_allocation_summary(), SolutionComparator, etc.), without hand-building that DataFrame.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| site_names | list of str | None |
|
| site_indices | list of int | The current network’s sites. At most one of these may be given. If neither is given, defaults to the sites flagged via add_sites(required_sites_col=...) – i.e. “the sites already required in every solution” – which is the existing network in the common case of modelling “which additional sites should we open”. Raises ValueError if neither is given and no required_sites_col is configured. |
None |
| objective | str | Forwarded to evaluate_single_solution_single_objective(). |
"p_median" |
| weights | dict | Forwarded to evaluate_single_solution_single_objective(). |
None |
| threshold_for_coverage | float or int | Forwarded to evaluate_single_solution_single_objective(). |
None |
| beyond_thresholds | float or sequence of float | Forwarded to evaluate_single_solution_single_objective() – reports the baseline’s own “left behind” headcounts alongside its coverage. |
None |
Returns
| Name | Type | Description |
|---|---|---|
| SiteSolutionSet | A one-row solution set wrapping the baseline evaluation. |
Raises
| Name | Type | Description |
|---|---|---|
| ValueError | If both site_names and site_indices are given (see evaluate_single_solution_single_objective()), or if neither is given and no required_sites_col was registered via add_sites(). |
Notes
Unlike evaluate_single_solution_single_objective() called directly, this mirrors solve()’s auto-setup: if no demand data has been registered via add_demand(), demand from all regions is assumed equal (with the same UserWarning solve() raises), rather than failing with a merge error when evaluate_single_solution_single_objective() hits demand_data is None. This is what lets evaluate_baseline() be called with no add_demand() step first, matching solve()’s own ergonomics.