Skip to content

policy_maker

agents.policy_maker

Policy maker agent module for the EcoWHEATaly model.

Defines the PolicyMaker agent that tracks Italian wheat market prices and manages the set of agri-environmental policies available to farms (eco-schemes and SRA interventions).

PolicyMaker

Bases: Agent

Repast4py agent representing the Italian policy maker.

The policy maker maintains a rolling history of Italian wheat prices and holds the DataFrame of available agri-environmental policies with their parameters (payments, input effects, administrative costs). It is shared across MPI ranks via the ghost agent mechanism.

Attributes:

Name Type Description
TYPE

Agent type identifier used by repast4py context.

updateItalianPricesHystory(latestPrice)

Append the latest wheat price and keep the last 12 entries.

Parameters:

Name Type Description Default
latestPrice

Most recent Italian wheat equilibrium price.

required

save()

Serialize the agent state for MPI communication.

Returns:

Type Description
Tuple

A tuple of (uid, italianPricesHystory, policies)

Tuple

used by restore_agent to reconstruct the agent.

update(italian_ph, italian_policies)

Update the ghost agent state without full reconstruction.

Called during MPI synchronization to refresh the ghost copy of this agent on remote ranks.

Parameters:

Name Type Description Default
italian_ph

Updated list of Italian wheat prices.

required
italian_policies

Updated policies DataFrame.

required

print_status()

Print a short status message identifying this agent.