exceptions.py 776B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 NoTypeInPheromone(NoPheromone):
  12. pass
  13. class NoCategoryInPheromone(NoPheromone):
  14. pass
  15. class BestPheromoneHere(PheromoneException):
  16. def __init__(self, best_distance, *args, **kwargs):
  17. super().__init__(*args, **kwargs)
  18. self._best_distance = best_distance
  19. def get_best_distance(self):
  20. return self._best_distance
  21. class BrainException(Exception):
  22. pass
  23. class BrainPartAlreadyExist(BrainException):
  24. pass
  25. class DirectionException(Exception):
  26. pass