agent_urban_planning.PreferenceWeights

class PreferenceWeights(alpha, beta, gamma, delta)[source]

Bases: object

Four-axis preference weights for an agent or archetype.

Captures the relative importance an agent assigns to housing affordability, commute, services/facilities, and amenities. Values are stored unnormalized; call normalized() to get a copy summing to 1.

Variables:
  • alpha – Weight on housing affordability.

  • beta – Weight on commute disutility.

  • gamma – Weight on services / facilities accessibility.

  • delta – Weight on neighborhood amenities.

Parameters:

Examples

>>> from agent_urban_planning.core.agents import PreferenceWeights
>>> w = PreferenceWeights(alpha=2.0, beta=1.0, gamma=1.0, delta=1.0)
>>> w.normalized().alpha
0.4
alpha: float
beta: float
gamma: float
delta: float
normalized()[source]

Return a normalized copy whose four weights sum to one.

Return type:

PreferenceWeights

Returns:

New PreferenceWeights whose components are scaled so alpha + beta + gamma + delta == 1.0. If all weights are zero, returns equal weights (0.25 each) to avoid a division-by-zero downstream.

Examples

>>> from agent_urban_planning.core.agents import PreferenceWeights
>>> PreferenceWeights(1.0, 1.0, 1.0, 1.0).normalized().alpha
0.25