Exercise 6: Simulated Annealing

I get a Test failed: without any explanations… the code seems to work and I seem to hit the global optimum something like 40 times of 50. Any ideas?

I also have another error which does not go away, see below. However, I think this is some kind of persistence problem, the row prob = math.exp(-(S_old-S_new)/T) which is indicated is not in my code at all any longer. Also resetting the code and then running it, will give a Test Failed: AssertionError: 1.0 not greater than 30 (as expected) BUT also the below. But maybe that is the reason for the Assert failing also with a piece of code which works?

The error which persists regardless of the code:
The answer is not correct - Test cases: 0 / 1

  File "/usr/local/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
    yield
  File "/usr/local/lib/python3.8/unittest/case.py", line 676, in run
    self._callTestMethod(testMethod)
  File "/usr/local/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
    method()
  File "/app/test/test_main.py", line 18, in test_answer
    main()
  File "/app/src/main.py", line 47, in main
    prob = math.exp(-(S_old-S_new)/T)
Error: math range error