You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the method of calculating likelihood for train problem is incorrect.
For example, if the sensor shows position 5, we can deduce from this that the train is definitely not in position 8, because it is too far from the sensor's readings.
The current method treats positions 6 and 8 as equally likely when reading from sensor is 5.
I think the correct function should look like this:
def lh_train(track, m, sensor_accuracy):
result = []
T = len(track)
for i in range(T):
if i in [(m - 1) % T, (m + 1) % T]:
result.append((1 - sensor_accuracy) / 2)
elif i == m:
result.append(sensor_accuracy)
else:
result.append(0)
return np.array(result)
By the way, I would like to point out that the modulo operation is missing in Train.sense() method. Currently, when we add sensor error, the resulting position may go outside the allowed position range.
The text was updated successfully, but these errors were encountered:
Hi,
I think the method of calculating likelihood for train problem is incorrect.
For example, if the sensor shows position 5, we can deduce from this that the train is definitely not in position 8, because it is too far from the sensor's readings.
The current method treats positions 6 and 8 as equally likely when reading from sensor is 5.
I think the correct function should look like this:
By the way, I would like to point out that the modulo operation is missing in
Train.sense()
method. Currently, when we add sensor error, the resulting position may go outside the allowed position range.The text was updated successfully, but these errors were encountered: