add function calc_optimal_policy and class decision