Skip to content

Unify Farmer & Trader into region-agnostic capability supersets (roles without regions) #31

Description

@Hackatro

Follow-up to #14 (which merged binding/param centralization into Archetype.params + shock-registry-from-PDL — not class unification). This ticket removes the region identity from the producer chain so instances differ only by PDL entity id + params — no ROLE_BRA/ARG/USA branching or region-string keying. Region routing/topology stays in #19.

In scope

  • Farmer: collapse _step_bra / _step_usa / _step_arg (farmer.py:109–187) into one _step_producer; keep ROLE_EU. Lift the only real asymmetry (USA) into two identity-default params: surplus_factor (default 1.0) and pricing_basis (default "actual"; USA = "nominal"). Fertilizer/capacity already route through effective() and default to 1.0 when unbound.

  • Migrate usa_surplus_factor from a hardcoded scenario read into the USA producer's archetype params (topology.py).

  • Trader: replace the farmer.role == "bra"/… bucketing (trader.py:123–143) with a dynamic map keyed by the producer's PDL origin id (volume_by_origin[origin] += taken). Expose an origin/entity id on the agent if not already carried.

  • Keep bra/arg/usa_volume as derived compatibility attributes so transport.py and the CSV schema stay untouched.

Out of scope

  • All transport.py routing (santos_share, _move_split, arg/usa port exclusion) and any CSV / data_collector / visualize_sql schema change.

Metadata

Metadata

Assignees

Labels

improvementFor everything that improves an already existing feature.simulation logicFor everything related to the internal simulation logic

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions