Skip to content

Commit b231235

Browse files
committed
fix bugs in comments for tiger tutorial
1 parent 8efc866 commit b231235

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

docs/_sphinx_src/examples.tiger.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ For the Tiger problem, we implemented this procedure as follows:
386386
print("True state:", tiger_problem.env.state)
387387
print("Belief:", tiger_problem.agent.cur_belief)
388388
print("Action:", action)
389-
# Step 3; no transition since actions in Tiger problem
389+
# Step 3; There is no state transition for the tiger domain.
390390
# In general, the ennvironment state can be transitioned
391391
# using
392392
#
@@ -402,10 +402,9 @@ For the Tiger problem, we implemented this procedure as follows:
402402
403403
# Step 4
404404
# Let's create some simulated real observation;
405-
# Update the belief Creating true observation for
406-
# sanity checking solver behavior. In general, this
407-
# observation should be sampled from agent's observation
408-
# model, as
405+
# Here, we use observation based on true state for sanity
406+
# checking solver behavior. In general, this observation
407+
# should be sampled from agent's observation model, as
409408
#
410409
# real_observation = tiger_problem.agent.observation_model.sample(tiger_problem.env.state, action)
411410
#
@@ -416,6 +415,8 @@ For the Tiger problem, we implemented this procedure as follows:
416415
print(">> Observation: %s" % real_observation)
417416
418417
# Step 5
418+
# Update the belief. If the planner is POMCP, planner.update
419+
# also automatically updates agent belief.
419420
tiger_problem.agent.update_history(action, real_observation)
420421
planner.update(tiger_problem.agent, action, real_observation)
421422
if isinstance(planner, pomdp_py.POUCT):

pomdp_problems/tiger/tiger_problem.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,10 +263,9 @@ def test_planner(tiger_problem, planner, nsteps=3,
263263
print("Reward:", reward)
264264

265265
# Let's create some simulated real observation;
266-
# Update the belief Creating true observation for
267-
# sanity checking solver behavior. In general, this
268-
# observation should be sampled from agent's observation
269-
# model, as
266+
# Here, we use observation based on true state for sanity
267+
# checking solver behavior. In general, this observation
268+
# should be sampled from agent's observation model, as
270269
#
271270
# real_observation = tiger_problem.agent.observation_model.sample(tiger_problem.env.state, action)
272271
#
@@ -277,7 +276,8 @@ def test_planner(tiger_problem, planner, nsteps=3,
277276
print(">> Observation:", real_observation)
278277
tiger_problem.agent.update_history(action, real_observation)
279278

280-
# If the planner is POMCP, planner.update also updates agent belief.
279+
# Update the belief. If the planner is POMCP, planner.update
280+
# also automatically updates agent belief.
281281
planner.update(tiger_problem.agent, action, real_observation)
282282
if isinstance(planner, pomdp_py.POUCT):
283283
print("Num sims:", planner.last_num_sims)

0 commit comments

Comments
 (0)