Skip to content

Commit

Permalink
fixed six_peaks.py bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jlm429 committed Feb 8, 2024
1 parent 64d39c1 commit 2c8f581
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mlrose_hiive/fitness/six_peaks.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ def evaluate(self, state):

# Calculate R(X, T)
_r = 0
_max_score = max(tail_0, head_1)
_max_score = max(head_0, head_1, tail_0, tail_1)
if tail_0 > _t and head_1 > _t:
_r = _n
elif tail_1 > _t and head_0 > _t:
_r = _n
_max_score = max(tail_1, head_0)

# Evaluate function
fitness = max(tail_0, head_1) + _r
fitness = _max_score + _r

return fitness

Expand Down

0 comments on commit 2c8f581

Please sign in to comment.