Skip to content

Resources

Resource realizations shared by the economics packages.

They are renewable resources that grow back.

RegrowthInteraction(label, *, target, state, capacity='capacity', growth='growth', relative=False, phase=None)

Bases: Interaction

Linear regrowth of a resource held by the agents of a group.

It grows by a fixed amount a step up to their capacity. Every step the resource x of an agent grows by the amount g its parameter growth names, x = min(K, x + g), or by that share of its capacity K when the regrowth is relative, x = min(K, x + g K). It is a rule of the system that grows every agent, such as the sugar of a patch of Sugarscape or the food of a plot of land.

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
target Role

The path of the group whose resource grows back.

required
state str

The name of the state that holds the resource.

required
capacity str

The name of the state or parameter of an agent that holds its capacity.

'capacity'
growth str

The name of the parameter of an agent that holds its regrowth in a step.

'growth'
relative bool

Whether the regrowth is a share of the capacity rather than an amount.

False
phase str | None

The phase of the step the regrowth runs in, or None for the default phase.

None

Examples:

>>> from skcomplex.systems.economics.common.resources import RegrowthInteraction
>>> regrowth = RegrowthInteraction('regrowth', target='patches', state='sugar', growth='growback')
>>> regrowth.growth
'growback'
Source code in src/skcomplex/systems/economics/common/resources/_regrowth.py
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
def __init__(
    self,
    label: str,
    *,
    target: Role,
    state: str,
    capacity: str = 'capacity',
    growth: str = 'growth',
    relative: bool = False,
    phase: str | None = None,
) -> None:
    super().__init__(label)
    self.target = target
    self.state = state
    self.capacity = capacity
    self.growth = growth
    self.relative = relative
    self.phase = phase