Skip to content

Commit

Permalink
Update TabuSearch.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored Jun 28, 2017
1 parent 5f8c3e9 commit 7877d68
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Solid/TabuSearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ def run(self, verbose=True):
self.cur_steps += 1

if ((i + 1) % 100 == 0) and verbose:
print self
print(self)

neighborhood = self._neighborhood()
neighborhood_best = self._best(neighborhood)

while True:
if all([x in self.tabu_list for x in neighborhood]):
print "TERMINATING - NO SUITABLE NEIGHBORS"
print("TERMINATING - NO SUITABLE NEIGHBORS")
return self.best, self._score(self.best)
if neighborhood_best in self.tabu_list:
if self._score(neighborhood_best) > self._score(self.best):
Expand All @@ -134,7 +134,7 @@ def run(self, verbose=True):
break

if self.max_score is not None and self._score(self.best) > self.max_score:
print "TERMINATING - REACHED MAXIMUM SCORE"
print("TERMINATING - REACHED MAXIMUM SCORE")
return self.best, self._score(self.best)
print "TERMINATING - REACHED MAXIMUM STEPS"
return self.best, self._score(self.best)
print("TERMINATING - REACHED MAXIMUM STEPS")
return self.best, self._score(self.best)

0 comments on commit 7877d68

Please sign in to comment.