Source code for palaestrai.util.exception
[docs]
class InvalidRequestError(Exception):
"""Raised when a wrong request was received."""
def __init__(self, expected, got):
super().__init__(f"Expected {expected}, got {got}.")
[docs]
class InvalidResponseError(Exception):
"""Raised when a wrong response was received."""
def __init__(self, expected, got):
super().__init__(f"Expected {expected}, got {got}.")
[docs]
class TasksNotFinishedError(Exception):
"""Raised when neither the signal_monitor_task nor the
transceive_task returned.
"""
[docs]
class InitializationFailedError(Exception):
"""Raised when initialization of an experiment failed."""
[docs]
class DeadChildrenRisingAsZombiesError(Exception):
"""Raised when childrens died and starting to become zombies."""
[docs]
class ExperimentAlreadyRunningError(Exception):
"""Raised during experiment start if experiment is already running."""
[docs]
class SimControllerFailedError(Exception):
"""Raised when a simulation controller could not be started."""
[docs]
class EnvConductorFailedError(Exception):
"""Raised when an error during the execution of an environment
conductor occurs.
"""
[docs]
class AgentConductorFailedError(Exception):
"""Raised when an error during the execution of an agent conductor
occurs.
"""
[docs]
class OutOfActionSpaceError(Exception):
"""This error is raised if an :class:`.ActuatorInformation`
receives a value that is not contained in the action space
of that actuator.
"""
[docs]
class OutOfObservationSpaceError(Exception):
"""This error is raised if a :class:`.SensorInformation` is
created with a value that is not contained in the observation
space of that sensor.
"""
[docs]
class UnknownModeError(Exception):
"""This error is raised if a :class:`palaestrai.agent.Muscle` is receiving
an unknown Mode."""
[docs]
class BrainMuscleConnectionFailedError(Exception):
"""This error is raised if the :class:`palaestrai.agent.Brain` is
unable to connect to the given port, because the port is already
used by another process."""
[docs]
class EnvironmentHasNoUIDError(Exception):
"""At least one environment in a multi-environment setup has no UID."""
[docs]
class SimulationSetupError(RuntimeError):
def __init__(self, experiment_run_id, message):
super().__init__(message)
self.message = message
self.experiment_run_id = experiment_run_id
def __str__(self):
return "%s (in experiment run: %s)" % (
self.message,
self.experiment_run_id,
)