MDP Solver

Synchronous value iteration for the repository’s estimated taxi model.

class src.mdp.model_based.MDPValueIteration(gamma: float = 0.5, epsilon: float = 0.0001, max_iterations: int = 100)[source]

Bases: object

Value iteration over relocation, pickup success/failure, and OD transitions.

q_values(state: int, origin_index: int) ndarray[source]

Return converged action values for one state and origin.

recommend(current_datetime: datetime, current_location_id: int) list[int][source]
src.mdp.model_based.bellman_backup(previous: ndarray, probability: ndarray, fare: ndarray, transition: ndarray, duration_slots: ndarray, move_slots: ndarray, reachable: ndarray, gamma: float) tuple[ndarray, ndarray][source]

Apply one Bellman optimality backup to a finite periodic model.

Returns the new value table and greedy action table, both indexed by [time_state, origin_zone].

src.mdp.model_based.recommend(current_datetime: datetime, current_location_id: int) list[int][source]