/
observationExceptions.py
69 lines (46 loc) · 2.14 KB
/
observationExceptions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright (c) 2019-2020, RTE (https://www.rte-france.com)
# See AUTHORS.txt
# This Source Code Form is subject to the terms of the Mozilla Public License, version 2.0.
# If a copy of the Mozilla Public License, version 2.0 was not distributed with this file,
# you can obtain one at http://mozilla.org/MPL/2.0/.
# SPDX-License-Identifier: MPL-2.0
# This file is part of Grid2Op, Grid2Op a testbed platform to model sequential decision making in power systems.
from grid2op.Exceptions.grid2OpException import Grid2OpException
class BaseObservationError(Grid2OpException):
"""
Generic type of exceptions raised by the observation
"""
pass
# BaseObservation
# Functionality not implemented by the observation
class NoForecastAvailable(Grid2OpException):
"""
This exception is mainly raised by the :class:`grid2op.Observation.BaseObservation`. It specifies the
:class:`grid2op.Agent.BaseAgent`
that the :class:`grid2op.Chronics.GridValue` doesn't produce any forecasts.
In that case it is not possible to use the :func:`grid2op.Observation.BaseObservation.forecasts` method.
"""
pass
class SimulateError(BaseObservationError):
"""
This is the generic exception related to :func:`grid2op.Observation.BaseObservation.simulate` function
"""
pass
class SimulateUsedTooMuch(SimulateError):
pass
class SimulateUsedTooMuchThisStep(SimulateUsedTooMuch):
"""
This exception is raised by the :class:`grid2op.Observation.BaseObservation` when using "obs.simulate(...)".
It is raised when the total number of calls to `obs.simulate(...)` exceeds the maximum number of allowed
calls to it, for a given step.
You can do more "obs.simulate" if you call "env.step".
"""
pass
class SimulateUsedTooMuchThisEpisode(SimulateUsedTooMuch):
"""
This exception is raised by the :class:`grid2op.Observation.BaseObservation` when using "obs.simulate(...)".
It is raised when the total number of calls to `obs.simulate(...)` exceeds the maximum number of allowed
calls to it for this episode.
The only way to use "obs.simulate(...)" again is to call "env.reset(...)"
"""
pass