Equal Allocation Agent

class or_suite.agents.resource_allocation.equal_allocation.equalAllocationAgent(epLen, env_config)[source]

Equal Allocation Agent subdivides the initial budget equally among all locations. Each location-specific allocation will be further subdivided (so as to create the matrix of allocation) by relative proportion of the types present at location i.

get_expected_endowments(N=1000)[source]

MCM for estimating Expectation of type distribution using N realizations.

reset()[source]

Resets bounds of agent to reflect upper and lower bounds of metric space.

update_config(env, config)[source]

Updates environment configuration dictionary.

update_obs(obs, action, reward, newObs, timestep, info)[source]

Add observation to records.

update_policy(k)[source]

Update internal policy based upon records.

pick_action(state, step)[source]

Move agent to midpoint or perturb current dimension

num_types

Number of types

Type

int

num_resources

Number of commodities

Type

int

current_budget

Amount of each commodity the principal begins with.

Type

int

epLen

Number of locations (also the length of an episode).

Type

int

data

All data observed so far

Type

list

rel_exp_endowments

Matrix containing expected proportion of endowments for location t

Type

matrix

__init__(epLen, env_config)[source]

Initialize equal_allocation agent

Parameters
  • epLen – number of steps

  • env_config – parameters used in initialization of environment

get_expected_endowments(N=1000)[source]

Monte Carlo Method for estimating Expectation of type distribution using N realizations Only need to run this once to get expectations for all locations Returns: rel_exp_endowments: matrix containing expected proportion of endowments for location t

pick_action(state, step)[source]

Returns allocation of resources based on budget times expectation of type distribution at current step divided by summation of expectation of type distribution over all future steps

Parameters
  • state – vector with first K entries denoting remaining budget, and remaining n entires denoting the number of people of each type that appear

  • step – timestep

Returns: matrix where each row is a K-dimensional vector denoting how

much of each commodity is given to each type

reset()[source]
update_config(env, config)[source]

Updates environment configuration dictionary

update_obs(obs, action, reward, newObs, timestep, info)[source]

Add observation to records

update_policy(k)[source]

Update internal policy based upon records