Repository navigation
Pharmacy service access
Since September 2026. This page describes the components of the
ServiceAccess branch and how
data flows through them. The method is on Lambda sweep method, the numbers on
Pharmacy results September 2026. The school-era scripts that the older
Service allocation procedure page describes (greedy-nn.jl, lp-greedy.jl, mip.jl) no longer
exist; their formulation survives as run_scenario in lp_run.jl, driven by lp.jl and greedy.jl.
GeoDMS (cfg/main.dms, STUDY_AREA=<area>) per study area
├─ NetworkSetup TomTom road network → cleaned, per-landbody connected network
├─ Analyses/…/Allocation impedance_matrix_od64: every populated 1 km² cell to every
│ candidate cell within its choice set → <area>_od.arrow
│ <area>_i.arrow (clients)
│ <area>_j.arrow (candidates)
└─ Analyses/Pharmacies/Descriptives catchment statistics of today's pharmacies
│
▼
Julia (lambda_sweep_simplex.jl → lp_run.jl → settings.jl)
├─ baseline every client → nearest existing pharmacy by road
├─ λ-sweep one LP per λ on the same model, warm-started dual simplex (HiGHS)
├─ rounding LP fractions → a real set of p pharmacies (multistart + swaps)
└─ S1 / S2 / S3 equal count · equal travel · the whole frontier
│ logs/sweep_<area>_<FUNC>.log
│ <area>/lambda_sweep/<FUNC>/<w=…|S1|S2>/{assignment,traveltime}.arrow
▼
doc/ (Python + Node) parse logs → charts → per-region slides → deck · frontier metrics
GeoDMS reads the S1/S2 open sets back (SweepResults) for mapping
Two travel-cost functions are swept in parallel — LINEAR c(t) = t (minutes) and an
adapted-logit LOGISTIC c(t) = 1 / (1 + e^{−(t−25)/10}) — and every result exists for both.
Two sides are computed per area: the observed network (ExistingPharmacies, the baseline)
and the candidate set (NewPharmacies: every cell with ≥ 50 residents, plus every cell that
holds a pharmacy today).
All under C:\LocalData\networkmodel_eu\{ExistingPharmacies,NewPharmacies}\:
| File | Columns | Notes |
|---|---|---|
<area>_od.arrow |
client_rel, facility_rel, t_ij, d_ij, … |
one row per OD pair the road network delivers within the choice set; t_ij in seconds |
<area>_i.arrow |
id, pop, total_pop, x, y, NUTS |
the clients — the same full-population list on both sides, so client_rel is comparable across them |
<area>_j.arrow |
id, x, y
|
the facilities; id is a per-file local index, so existing and candidate facilities can only be matched by (x, y)
|
<area>/lambda_sweep/<FUNC>/<label>/assignment.arrow |
id, open
|
one folder per sweep point (w=…), plus S1, S2, and baseline on the existing side |
<area>/lambda_sweep/<FUNC>/<label>/traveltime.arrow |
id, t_ij
|
per client, minutes to its assigned open facility |
| `_<s1 | s2>_<linear | logistic>_open.arrow` |
| Item | Role |
|---|---|
cfg/main.dms, ModelParameters.dms
|
Study area from the STUDY_AREA environment variable (Expand(., '%env:STUDY_AREA%')), grid size, Client := 'population', the choice-set knobs max_nr_facilities_per_client := 5 and max_traveltime_to_facility := 120 min. |
NetworkSetup.dms, Templates.dms
|
Builds the working road network from the TomTom extract (CreateInitialWorkingNetwork → CreateMoreEfficientNetwork). Keeps the largest strongly-connected component per landbody, not one per study area, so islands and their ferry links survive. |
Analyses.dms → Allocate_T
|
The OD matrix: impedance_matrix_od64('bidirectional(link_flag);startPoint(Node_rel);endPoint(Node_rel);cut(OrgZone_max_imp);limit(OrgZone_max_mass,DstZone_mass);alternative(link_imp):alt_imp;od:OrgZone_rel,DstZone_rel,impedance', …). cut = 120 min; limit = 5 with mass 1 only on existing-pharmacy cells, so a client's choice set is every candidate within the road time to its 5th-nearest existing pharmacy. Exports DistanceTableExport, ClientExport, FacilityExport. |
Analyses/AllocateClientsToExistingPharmacies, …ToNewPharmacies
|
The two sides, each an Allocate_T instance. |
Analyses/Pharmacies/Descriptives |
Today's network by road catchment: residents per pharmacy and per 1 km² location, empty (never-nearest) pharmacies, catchment percentiles. One Arrow row per area, gathered by collect_descriptives.jl. |
Analyses/…/SweepResults (ReadSweepResults_T) |
Reads baseline, S1, S2 per travel function back into GeoDMS. |
SourceData/Locations.dms services_allocated
|
Reads the exported open-location files. |
| File | Role |
|---|---|
settings.jl |
Paths, COUNTRIES, the travel-cost functions c(t), big_cost(), facility-cost placeholders (FACILITY_MIN_COSTS = 100 000), Arrow loaders, the candidate-subsampling knob, and the region-exclusion rule. Everything is env-overridable. |
lp_run.jl |
The engine. build_lp_warmstart / solve_at_w! — the soft-coverage LP, solved along the λ-grid from the previous basis; greedy_round, multistart_round, swap_round!, travel_of, assign_nearest — rounding and scoring; run_scenario — the older hard-coverage LP with a minimum-catchment penalty. |
lambda_sweep_simplex.jl |
The sweep driver used for all results. Baseline metrics, the common w-grid, per-w LP → rounding → log line, S1/S2 bracketing, the per-point Arrow outputs. |
lambda_sweep.jl |
Earlier parallel variant (one fresh LP per w). Superseded; kept for reference. |
lp.jl, greedy.jl, greedy-merge.jl
|
School-era scenario runners over run_scenario: hard coverage, min_clients deficit penalty, IPM; grid searches. Not used for the pharmacy results. |
cap_scenario.jl, s1_cap.jl, s2_cap.jl
|
The catchment-cap ladder without a cost function (S1-A/B/C, S2-A/B). Explored on the Netherlands; not pursued. |
export_s1s2_locations.jl |
Joins each area's S1/S2 assignment.arrow to <area>_j.arrow and writes the open locations. |
collect_descriptives.jl |
Gathers the descriptive Arrow rows into doc/pharmacy_descriptives.csv (+ _nuts1.csv). |
| Script | Role |
|---|---|
run_pharmacy_pipeline.bat <area…> |
GeoDMS, existing side: steps network1 network2 alloc (subset via STEPS). |
run_new_pharmacy_pipeline.bat <area…> |
GeoDMS, candidate side: the same three steps. |
run_new_country_sweeps.ps1 |
Orchestrator for a new area: both pipelines, then the LINEAR and LOGISTIC sweeps; resumable; progress to logs/orchestrator_progress.log. |
run_rebuild_all.ps1, run_realloc_all.ps1
|
Rebuild networks + ODs on both sides / re-export only the client and facility tables. |
run_recalc_batch.ps1, run_resweep_batch.ps1
|
Per-area workers: rebuild + re-sweep, or sweep only. Several run side by side in visible consoles. |
run_cap_scenarios.bat, make_descriptive_table.bat
|
The cap-ladder runs; the descriptive table over all areas. |
build_deck_data.py (logs → deck_data.json) → build_charts.py (per-region charts) →
build_deck.mjs (region + summary slides, pptxgenjs) → merge_deck.ps1 (concept slides +
generated slides → lambda_sweep5.pptx). frontier_metrics.py computes the improvement
rectangle, the diagonal crossing and λ at the crossing per area (frontier_metrics_interp3.csv);
frontier_charts.py draws the ranked lists; policy_typology.py attaches the regulation typology
used to colour them. doc/README_deck.md has the run order.
Prerequisites: GeoDMS 20.19.1 or later (GEODMS_EXE), the TomTom extract under
%NetworkModelDataDir%\Infrastructure\TomTom\<area>\, GeoDMS's LocalDataDir/SourceDataDir
settings, and Julia with Arrow, JuMP, HiGHS (Installation of Julia).
run_pharmacy_pipeline.bat Netherlands :: existing side
run_new_pharmacy_pipeline.bat Netherlands :: candidate side
set TRAVEL_FUNC=LINEAR && julia lambda_sweep_simplex.jl > logs\sweep_Netherlands_LINEAR.log
set TRAVEL_FUNC=LOGISTIC && julia lambda_sweep_simplex.jl > logs\sweep_Netherlands_LOGISTIC.log
or run_new_country_sweeps.ps1 for a new area end to end. Sweep knobs are environment
variables — COUNTRIES, TRAVEL_FUNC, SWEEP_WMAX, SWEEP_MULTS, SOLVER, LP_TIME_LIMIT,
LOCATION_SELECTION_FACTOR, PROTECT_BASELINE, ROUNDING, MS_RESTARTS/ROUNDS/SEED,
BIG_TRAVELTIME_MIN, LOGISTIC_MIDPOINT/SCALE, NUTS_EXCLUSION, NUTS_EXCLUDE_SHARE —
listed with their defaults in settings.jl.
Sweep cost: minutes per λ-point for most areas, hours for the largest (Poland country-level:
15.1 M OD rows, 29 h LINEAR). The largest areas are candidate-subsampled
(LOCATION_SELECTION_FACTOR), keeping every baseline location so the frontier still dominates
the baseline.
NetworkModel EU documentation
Start here
Understanding the method
- The facility location model explained
- Travel cost functions
- The lambda sweep and the Pareto frontier
- From LP fractions to real pharmacies
- Scenarios S1 S2 S3
- Scope rules and data gaps
- Metrics aggregation and ranking
- Background theory
Working with the code
- GeoDMS OD matrix and choice set
- Code walkthrough settings
- Code walkthrough lp_run
- Code walkthrough lambda_sweep_simplex
- Running a sweep end to end
- Log lines and output files
- Deck and charts pipeline
- Installation of Julia
Reference
- Lambda sweep method
- Pharmacy service access
- Pharmacy results September 2026
- Decision log
- Alternatives not pursued
- FAQ
- Glossary
- Service allocation procedure
External