reasoning under uncertainty hmm_ pos hmm_controlled(local_states{'door'}local_obsact trans[ / for in range( )]to change the ve localization code to allow for controlled hmmsnotice that the action selects which transition probability to us problocalization py -(continued class hmm_local(hmmvefilter)"""ve filter for controlled hmms ""def __init__(selfhmm)hmmvefilter __init__(selfhmm def go(selfaction)self hmm trans self hmm act trans[actionself advance( loc_filt hmm_local(hmm_ posloc_filt observe({'door':true})loc_filt go("right")loc_filt observe({'door':false})loc_filt go("right")loc_filt observe({'door':true}loc_filt state_dist the following lets us interactively move the agent and provide observations it shows the distribution over locations problocalization py -(continued class show_localization(displayable)def __init__(self,hmm)self hmm hmm self loc_filt hmm_local(hmmfig,(self axplt subplots(plt subplots_adjust(bottom= left_butt button(plt axes([ , , , ])"left"left_butt on_clicked(self leftright_butt button(plt axes([ , , , ])"right"right_butt on_clicked(self rightdoor_butt button(plt axes([ , , , ])"door"door_butt on_clicked(self doornodoor_butt button(plt axes([ , , , ])"no door"nodoor_butt on_clicked(self nodoorreset_butt button(plt axes([ , , , ])"reset"reset_butt on_clicked(self reset#this makes sure -axis goes to graph overwritten in draw_dist self draw_dist(plt show( def draw_dist(self)self ax clear(plt ylim( , version june