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
copy_state() returns None when self.copy_strategy is mistakenly set up.
Then the error message is not easy to understand.
For example, when I set tsp.copy_strategy = "copy" instead of "slice" in example/salesman.py,
the output was like this.
$ python examples/salesman.py
Temperature Energy Accept Improve Elapsed Remaining
Traceback (most recent call last): 0:00:00
File "examples/salesman.py", line 88, in <module>
state, e = tsp.anneal()
File "../simanneal/simanneal/anneal.py", line 192, in anneal
self.move()
File "examples/salesman.py", line 31, in move
a = random.randint(0, len(self.state) - 1)
TypeError: object of type 'NoneType' has no len()
It took time to know where the 'NoneType' came from.
It would be useful if we can see the cause is tsp.copy_strategy.
The text was updated successfully, but these errors were encountered:
copy_state()
returnsNone
whenself.copy_strategy
is mistakenly set up.Then the error message is not easy to understand.
For example, when I set
tsp.copy_strategy = "copy"
instead of"slice"
in example/salesman.py,the output was like this.
It took time to know where the 'NoneType' came from.
It would be useful if we can see the cause is
tsp.copy_strategy
.The text was updated successfully, but these errors were encountered: