Skip to content

Commit

Permalink
random sample needs sequence (in rocksample)
Browse files Browse the repository at this point in the history
  • Loading branch information
zkytony committed Jan 27, 2024
1 parent 464ebbc commit 3c6b8a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pomdp_py/problems/rocksample/rocksample_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def argmax(self, state, normalized=False, **kwargs):
def get_all_actions(self, **kwargs):
state = kwargs.get("state", None)
if state is None:
return self._all_actions
return list(self._all_actions)
else:
motions = set(self._all_actions)
rover_x, rover_y = state.position
Expand All @@ -355,7 +355,7 @@ def get_all_actions(self, **kwargs):
motions.remove(MoveNorth)
if rover_y == self._n - 1:
motions.remove(MoveSouth)
return motions | self._other_actions
return list(motions | self._other_actions)

def rollout(self, state, history=None):
return random.sample(self.get_all_actions(state=state), 1)[0]
Expand Down Expand Up @@ -529,7 +529,7 @@ def main():

print("*** Testing POMCP ***")
pomcp = pomdp_py.POMCP(
max_depth=20,
max_depth=12,
discount_factor=0.95,
num_sims=10000,
exploration_const=20,
Expand Down

0 comments on commit 3c6b8a0

Please sign in to comment.