h2r / pomdp-py

A framework to build and solve POMDP problems. Documentation: https://h2r.github.io/pomdp-py/
MIT License
216 stars 50 forks source link

Transition and probability in Update belief of Multi Object Search #40

Closed RajeshDM closed 9 months ago

RajeshDM commented 9 months ago

I am currently using the Multi-object search example. While going through the code of update_histogram_belief ... I came across this issue : https://github.com/h2r/pomdp-py/blob/85d9a3182e6a883e44315617c9fdfde484d05c01/pomdp_py/representations/belief/histogram.py#L64

If the transitions are not deterministic, the probability function of the current object will be called with the "ObjectState" .

But in the line https://github.com/h2r/pomdp-py/blob/85d9a3182e6a883e44315617c9fdfde484d05c01/pomdp_problems/multi_object_search/models/transition_model.py#L57, it expects the full "MosOOState". Is there any way to resolve this?

zkytony commented 9 months ago

In MOS, the belief state over objects are individually updated and collected together via OOBelief. To address the issue, you can call update_histogram_belief on every object belief state, and pass in the set of object states as the next_state_space argument to update_histogram_belief.

RajeshDM commented 9 months ago

In MOS, the belief state over objects are individually updated and collected together via OOBelief. To address the issue, you can call update_histogram_belief on every object belief state, and pass in the set of object states as the next_state_space argument to update_histogram_belief.

I believe the update_histogram_belief is already being called on every object belief state in the current code. It is the next_state_space construction that was causing the issue - each state in the next state space must be of the type MOSOOState because the probability function is defined on that. I just realized I can update the probability function to accept both types of states (similar to how the observation_model.probability can work with both types of objects).

Thank you.