exceptions.py 525B

12345678910111213141516171819202122232425262728
  1. class MovementException(Exception):
  2. pass
  3. class SamePosition(MovementException):
  4. pass
  5. class PheromoneException(Exception):
  6. pass
  7. class NoPheromone(PheromoneException):
  8. pass
  9. class NoPheromoneMove(PheromoneException, MovementException):
  10. pass
  11. class BestPheromoneHere(PheromoneException):
  12. def __init__(self, best_distance, *args, **kwargs):
  13. super().__init__(*args, **kwargs)
  14. self._best_distance = best_distance
  15. def get_best_distance(self):
  16. return self._best_distance