Skip to content

Commit d2a808a

Browse files
committed
bug fix in particles.add
1 parent 5c1837c commit d2a808a

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Changelog
33

44
Best viewed on `the website <https://h2r.github.io/pomdp-py/html/changelog.html>`_.
55

6+
Version 1.3.0.2 (pending)
7+
-------------------------
8+
* bug fix in :py:mod:`~pomdp_py.representations.distribution.particles` (in :code:`add`)
9+
610
Version 1.3.0.1 (09/30/2021)
711
----------------------------
812

pomdp_py/representations/distribution/particles.pyx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,11 @@ cdef class WeightedParticles(GenerativeDistribution):
9797
return value
9898

9999
def mpe(self):
100+
print(self._hist_valid)
100101
if not self._hist_valid:
101102
self._hist = self.get_histogram()
102103
self._hist_valid = True
104+
print(self._hist)
103105
return max(self._hist, key=self._hist.get)
104106

105107
def __iter__(self):
@@ -165,6 +167,7 @@ cdef class Particles(WeightedParticles):
165167
self._particles.append((particle, None))
166168
self._values.append(particle)
167169
self._weights.append(None)
170+
self._hist_valid = False
168171

169172
@property
170173
def particles(self):

0 commit comments

Comments
 (0)