Median sklearn Agent

class or_suite.agents.ambulance.median_sklearn.median_sklearnAgent(epLen)[source]

Agent that implements a k-medoid heuristic algorithm for the metric ambulance environment

reset()[source]

Clears data and call_locs which contain data on what has occurred so far in the environment

update_config()

(UNIMPLEMENTED)

pick_action(state, step)[source]

Locations are chosen by finding the k-medoids in the accumulated arrival data, where k is the number of ambulances, using sci-kit learn’s k-medoids algorithm

epLen

(int) number of time steps to run the experiment for

data

(float list list) a list of all the states of the environment observed so far

call_locs

(float list) the locations of all calls observed so far

__init__(epLen)[source]
Parameters

epLen – (int) number of time steps to run the experiment for

greedy(state, timestep, epsilon=0)[source]

For the first iteration, choose the starting state After that, choose locations for the ambulances that are most centrally located to the locations of previous calls using the k-medoids algorithm For more details about the k-medoids algorithm, see the readme document for the ambulance environment or the sci-kit learn documentation

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

Adds newObs, the most recently observed state, to data adds the most recent call arrival, found in info[‘arrival’] to call_locs.

update_policy(k)[source]

Update internal policy based upon records.

Not used, because a greedy algorithm does not have a policy.