Skip to content

38 make transport roles and routing fully pdl derived - #40

Open
Hackatro wants to merge 12 commits into
mainfrom
38-make-transport-roles-and-routing-fully-pdl-derived
Open

38 make transport roles and routing fully pdl derived#40
Hackatro wants to merge 12 commits into
mainfrom
38-make-transport-roles-and-routing-fully-pdl-derived

Conversation

@Hackatro

Copy link
Copy Markdown
Contributor

Removes the last place-named couplings in the transport layer so a swapped PDL runs
without touching agent code. This is an identity change, not a behaviour change.

Scope

Values are identical per corresponding series against the Step 0 post-rebase baseline.

Identifiers change only within an enumerated, reviewed set: transport list names, role constants, count attrs, adjacency references, execution-order strings, and the derived result-table names (which follow list names via _result_name()).

Limitation

  • This PR does not change how the code decides a stage is a sea crossing. topology.pystill holds LOCATION_CONTINENT (hardcoded continent dict), and derive_sea_edges classifies a stage as a crossing only when both endpoints resolve to known, different continents.
  • Unknown location yields no crossing at all -> no error, no warning, no transport lane
  • A PDL with unlisted location siliently loses its sea transport lane.

One producer recipe, sidecar roster, output names follow brazil_farms / ArgentinaFarms / UsFarms. Values unchanged vs the byte-for-byte gate.
- DROUGHT_KEY hardcoded ("brazil_farms", "supply"), so a PDL that droughts a
different producer reported drought_severity as 0.0 all run.
- Severity is now the worst active supply
degradation across the roster's producers.
- Verified: Result_Simulator_Environment.csv byte-identical before and after.
Implemented:
- roster-derived peer-list identity
- generic land transport and sea-lane roles
- topology-derived transport lists and sea crossings
- graph-driven routing dispatch and generic count fallbacks
Not yet implemented:
- farmer and trader hardcoded list cleanup
- roster-derived environment transport aggregation
- routing and export contract updates
- topology snapshot regeneration
- final numeric and alternate-PDL verification
- Remove the last place-named couplings so a swapped PDL runs without touching agent code
- The eight n_transport_sa_* / n_transport_eu_* / n_sea_lane_* scenario fields and their SimulatorScenarios columns went inert once transport lists became entity-derived
- Baseline outputs are unchanged
@Hackatro Hackatro linked an issue Aug 31, 2026 that may be closed by this pull request
agents/trader.py — Trading actors.

role="wholesaler" Aggregates soja from BRA + USA farmers (greedy cheapest first)
role="wholesaler" Aggregates soja from one producing region

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soja is "soy" in English.
It should be changed for all occurrences.

n_sea_lane_usa: int = 1 # Sea agents: USA Gulf -> Rotterdam
n_transport_eu_rtm: int = 1 # Rotterdam EU entry port agents
n_transport_eu_ham: int = 1 # Hamburg EU entry port agents
n_brazil_farms: int = 10 # South American Farmers

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this also be removed from the scenario file?

Instantiagte once per simulation run - the constructor truncates
the tick tables so each run starts clean.
Instantiate once per simulation run - the first write_tick() drops the
roster's tick tables so each run starts clean.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean that all data of previous runs is lost?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make transport roles and routing fully PDL-derived

2 participants