Median Agent
- class or_suite.agents.ambulance.median.medianAgent(epLen)[source]
Agent that implements a median-like heuristic algorithm for the metric environment. The data on previous call locations is sorted by location and split into k quantiles, where k is the number of ambulances. The midpoint of each quantile is chosen as the location for one of the ambulances.
- 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 the midpoints of each of k quantiles of the arrival data sorted by location, where k is the number of ambulances
- 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
- greedy(state, timestep, epsilon=0)[source]
This algorithm sorts all previous arrivals, and splits them into k quantiles, where k is the number of ambulances. It then finds the median of each quantile, and positions an ambulance there.