# builders.domain.events
Domain specification
# Events
A domain must inherit this class if it handles events (controllable or not not by the agents).
# get_action_space Events
get_action_space(
self
) -> StrDict[Space[D.T_event]]
Get the (cached) domain action space (finite or infinite set).
By default, Events.get_action_space()
internally calls Events._get_action_space_()
the first time and
automatically caches its value to make future calls more efficient (since the action space is assumed to be
constant).
# Returns
The action space.
# get_applicable_actions Events
get_applicable_actions(
self,
memory: Optional[Memory[D.T_state]] = None
) -> StrDict[Space[D.T_event]]
Get the space (finite or infinite set) of applicable actions in the given memory (state or history), or in the internal one if omitted.
By default, Events.get_applicable_actions()
provides some boilerplate code and internally
calls Events._get_applicable_actions()
. The boilerplate code automatically passes the _memory
attribute
instead of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
The space of applicable actions.
# get_enabled_events Events
get_enabled_events(
self,
memory: Optional[Memory[D.T_state]] = None
) -> Space[D.T_event]
Get the space (finite or infinite set) of enabled uncontrollable events in the given memory (state or history), or in the internal one if omitted.
By default, Events.get_enabled_events()
provides some boilerplate code and internally
calls Events._get_enabled_events()
. The boilerplate code automatically passes the _memory
attribute instead of
the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
The space of enabled events.
# is_action Events
is_action(
self,
event: D.T_event
) -> bool
Indicate whether an event is an action (i.e. a controllable event for the agents).
TIP
By default, this function is implemented using the skdecide.core.Space.contains()
function on the domain
action space provided by Events.get_action_space()
, but it can be overridden for faster implementations.
# Parameters
- event: The event to consider.
# Returns
True if the event is an action (False otherwise).
# is_applicable_action Events
is_applicable_action(
self,
action: StrDict[D.T_event],
memory: Optional[Memory[D.T_state]] = None
) -> bool
Indicate whether an action is applicable in the given memory (state or history), or in the internal one if omitted.
By default, Events.is_applicable_action()
provides some boilerplate code and internally
calls Events._is_applicable_action()
. The boilerplate code automatically passes the _memory
attribute instead
of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
True if the action is applicable (False otherwise).
# is_enabled_event Events
is_enabled_event(
self,
event: D.T_event,
memory: Optional[Memory[D.T_state]] = None
) -> bool
Indicate whether an uncontrollable event is enabled in the given memory (state or history), or in the internal one if omitted.
By default, Events.is_enabled_event()
provides some boilerplate code and internally
calls Events._is_enabled_event()
. The boilerplate code automatically passes the _memory
attribute instead of
the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
True if the event is enabled (False otherwise).
# _get_action_space Events
_get_action_space(
self
) -> StrDict[Space[D.T_event]]
Get the (cached) domain action space (finite or infinite set).
By default, Events._get_action_space()
internally calls Events._get_action_space_()
the first time and
automatically caches its value to make future calls more efficient (since the action space is assumed to be
constant).
# Returns
The action space.
# _get_action_space_ Events
_get_action_space_(
self
) -> StrDict[Space[D.T_event]]
Get the domain action space (finite or infinite set).
This is a helper function called by default from Events._get_action_space()
, the difference being that the
result is not cached here.
TIP
The underscore at the end of this function's name is a convention to remind that its result should be constant.
# Returns
The action space.
# _get_applicable_actions Events
_get_applicable_actions(
self,
memory: Optional[Memory[D.T_state]] = None
) -> StrDict[Space[D.T_event]]
Get the space (finite or infinite set) of applicable actions in the given memory (state or history), or in the internal one if omitted.
By default, Events._get_applicable_actions()
provides some boilerplate code and internally
calls Events._get_applicable_actions_from()
. The boilerplate code automatically passes the _memory
attribute
instead of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
The space of applicable actions.
# _get_applicable_actions_from Events
_get_applicable_actions_from(
self,
memory: Memory[D.T_state]
) -> StrDict[Space[D.T_event]]
Get the space (finite or infinite set) of applicable actions in the given memory (state or history).
This is a helper function called by default from Events._get_applicable_actions()
, the difference being that
the memory parameter is mandatory here.
# Parameters
- memory: The memory to consider.
# Returns
The space of applicable actions.
# _get_enabled_events Events
_get_enabled_events(
self,
memory: Optional[Memory[D.T_state]] = None
) -> Space[D.T_event]
Get the space (finite or infinite set) of enabled uncontrollable events in the given memory (state or history), or in the internal one if omitted.
By default, Events._get_enabled_events()
provides some boilerplate code and internally
calls Events._get_enabled_events_from()
. The boilerplate code automatically passes the _memory
attribute
instead of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
The space of enabled events.
# _get_enabled_events_from Events
_get_enabled_events_from(
self,
memory: Memory[D.T_state]
) -> Space[D.T_event]
Get the space (finite or infinite set) of enabled uncontrollable events in the given memory (state or history).
This is a helper function called by default from Events._get_enabled_events()
, the difference being that the
memory parameter is mandatory here.
# Parameters
- memory: The memory to consider.
# Returns
The space of enabled events.
# _is_action Events
_is_action(
self,
event: D.T_event
) -> bool
Indicate whether an event is an action (i.e. a controllable event for the agents).
TIP
By default, this function is implemented using the skdecide.core.Space.contains()
function on the domain
action space provided by Events._get_action_space()
, but it can be overridden for faster implementations.
# Parameters
- event: The event to consider.
# Returns
True if the event is an action (False otherwise).
# _is_applicable_action Events
_is_applicable_action(
self,
action: StrDict[D.T_event],
memory: Optional[Memory[D.T_state]] = None
) -> bool
Indicate whether an action is applicable in the given memory (state or history), or in the internal one if omitted.
By default, Events._is_applicable_action()
provides some boilerplate code and internally
calls Events._is_applicable_action_from()
. The boilerplate code automatically passes the _memory
attribute
instead of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
True if the action is applicable (False otherwise).
# _is_applicable_action_from Events
_is_applicable_action_from(
self,
action: StrDict[D.T_event],
memory: Memory[D.T_state]
) -> bool
Indicate whether an action is applicable in the given memory (state or history).
This is a helper function called by default from Events._is_applicable_action()
, the difference being that the
memory parameter is mandatory here.
TIP
By default, this function is implemented using the skdecide.core.Space.contains()
function on the space of
applicable actions provided by Events._get_applicable_actions_from()
, but it can be overridden for faster
implementations.
# Parameters
- memory: The memory to consider.
# Returns
True if the action is applicable (False otherwise).
# _is_enabled_event Events
_is_enabled_event(
self,
event: D.T_event,
memory: Optional[Memory[D.T_state]] = None
) -> bool
Indicate whether an uncontrollable event is enabled in the given memory (state or history), or in the internal one if omitted.
By default, Events._is_enabled_event()
provides some boilerplate code and internally
calls Events._is_enabled_event_from()
. The boilerplate code automatically passes the _memory
attribute instead
of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
True if the event is enabled (False otherwise).
# _is_enabled_event_from Events
_is_enabled_event_from(
self,
event: D.T_event,
memory: Memory[D.T_state]
) -> bool
Indicate whether an event is enabled in the given memory (state or history).
This is a helper function called by default from Events._is_enabled_event()
, the difference being that the
memory parameter is mandatory here.
TIP
By default, this function is implemented using the skdecide.core.Space.contains()
function on the space of
enabled events provided by Events._get_enabled_events_from()
, but it can be overridden for faster
implementations.
# Parameters
- memory: The memory to consider.
# Returns
True if the event is enabled (False otherwise).
# Actions
A domain must inherit this class if it handles only actions (i.e. controllable events).
# get_action_space Events
get_action_space(
self
) -> StrDict[Space[D.T_event]]
Get the (cached) domain action space (finite or infinite set).
By default, Events.get_action_space()
internally calls Events._get_action_space_()
the first time and
automatically caches its value to make future calls more efficient (since the action space is assumed to be
constant).
# Returns
The action space.
# get_applicable_actions Events
get_applicable_actions(
self,
memory: Optional[Memory[D.T_state]] = None
) -> StrDict[Space[D.T_event]]
Get the space (finite or infinite set) of applicable actions in the given memory (state or history), or in the internal one if omitted.
By default, Events.get_applicable_actions()
provides some boilerplate code and internally
calls Events._get_applicable_actions()
. The boilerplate code automatically passes the _memory
attribute
instead of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
The space of applicable actions.
# get_enabled_events Events
get_enabled_events(
self,
memory: Optional[Memory[D.T_state]] = None
) -> Space[D.T_event]
Get the space (finite or infinite set) of enabled uncontrollable events in the given memory (state or history), or in the internal one if omitted.
By default, Events.get_enabled_events()
provides some boilerplate code and internally
calls Events._get_enabled_events()
. The boilerplate code automatically passes the _memory
attribute instead of
the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
The space of enabled events.
# is_action Events
is_action(
self,
event: D.T_event
) -> bool
Indicate whether an event is an action (i.e. a controllable event for the agents).
TIP
By default, this function is implemented using the skdecide.core.Space.contains()
function on the domain
action space provided by Events.get_action_space()
, but it can be overridden for faster implementations.
# Parameters
- event: The event to consider.
# Returns
True if the event is an action (False otherwise).
# is_applicable_action Events
is_applicable_action(
self,
action: StrDict[D.T_event],
memory: Optional[Memory[D.T_state]] = None
) -> bool
Indicate whether an action is applicable in the given memory (state or history), or in the internal one if omitted.
By default, Events.is_applicable_action()
provides some boilerplate code and internally
calls Events._is_applicable_action()
. The boilerplate code automatically passes the _memory
attribute instead
of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
True if the action is applicable (False otherwise).
# is_enabled_event Events
is_enabled_event(
self,
event: D.T_event,
memory: Optional[Memory[D.T_state]] = None
) -> bool
Indicate whether an uncontrollable event is enabled in the given memory (state or history), or in the internal one if omitted.
By default, Events.is_enabled_event()
provides some boilerplate code and internally
calls Events._is_enabled_event()
. The boilerplate code automatically passes the _memory
attribute instead of
the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
True if the event is enabled (False otherwise).
# _get_action_space Events
_get_action_space(
self
) -> StrDict[Space[D.T_event]]
Get the (cached) domain action space (finite or infinite set).
By default, Events._get_action_space()
internally calls Events._get_action_space_()
the first time and
automatically caches its value to make future calls more efficient (since the action space is assumed to be
constant).
# Returns
The action space.
# _get_action_space_ Events
_get_action_space_(
self
) -> StrDict[Space[D.T_event]]
Get the domain action space (finite or infinite set).
This is a helper function called by default from Events._get_action_space()
, the difference being that the
result is not cached here.
TIP
The underscore at the end of this function's name is a convention to remind that its result should be constant.
# Returns
The action space.
# _get_applicable_actions Events
_get_applicable_actions(
self,
memory: Optional[Memory[D.T_state]] = None
) -> StrDict[Space[D.T_event]]
Get the space (finite or infinite set) of applicable actions in the given memory (state or history), or in the internal one if omitted.
By default, Events._get_applicable_actions()
provides some boilerplate code and internally
calls Events._get_applicable_actions_from()
. The boilerplate code automatically passes the _memory
attribute
instead of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
The space of applicable actions.
# _get_applicable_actions_from Events
_get_applicable_actions_from(
self,
memory: Memory[D.T_state]
) -> StrDict[Space[D.T_event]]
Get the space (finite or infinite set) of applicable actions in the given memory (state or history).
This is a helper function called by default from Events._get_applicable_actions()
, the difference being that
the memory parameter is mandatory here.
# Parameters
- memory: The memory to consider.
# Returns
The space of applicable actions.
# _get_enabled_events Events
_get_enabled_events(
self,
memory: Optional[Memory[D.T_state]] = None
) -> Space[D.T_event]
Get the space (finite or infinite set) of enabled uncontrollable events in the given memory (state or history), or in the internal one if omitted.
By default, Events._get_enabled_events()
provides some boilerplate code and internally
calls Events._get_enabled_events_from()
. The boilerplate code automatically passes the _memory
attribute
instead of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
The space of enabled events.
# _get_enabled_events_from Events
_get_enabled_events_from(
self,
memory: Memory[D.T_state]
) -> Space[D.T_event]
Get the space (finite or infinite set) of enabled uncontrollable events in the given memory (state or history).
This is a helper function called by default from Events._get_enabled_events()
, the difference being that the
memory parameter is mandatory here.
# Parameters
- memory: The memory to consider.
# Returns
The space of enabled events.
# _is_action Events
_is_action(
self,
event: D.T_event
) -> bool
Indicate whether an event is an action (i.e. a controllable event for the agents).
TIP
By default, this function is implemented using the skdecide.core.Space.contains()
function on the domain
action space provided by Events._get_action_space()
, but it can be overridden for faster implementations.
# Parameters
- event: The event to consider.
# Returns
True if the event is an action (False otherwise).
# _is_applicable_action Events
_is_applicable_action(
self,
action: StrDict[D.T_event],
memory: Optional[Memory[D.T_state]] = None
) -> bool
Indicate whether an action is applicable in the given memory (state or history), or in the internal one if omitted.
By default, Events._is_applicable_action()
provides some boilerplate code and internally
calls Events._is_applicable_action_from()
. The boilerplate code automatically passes the _memory
attribute
instead of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
True if the action is applicable (False otherwise).
# _is_applicable_action_from Events
_is_applicable_action_from(
self,
action: StrDict[D.T_event],
memory: Memory[D.T_state]
) -> bool
Indicate whether an action is applicable in the given memory (state or history).
This is a helper function called by default from Events._is_applicable_action()
, the difference being that the
memory parameter is mandatory here.
TIP
By default, this function is implemented using the skdecide.core.Space.contains()
function on the space of
applicable actions provided by Events._get_applicable_actions_from()
, but it can be overridden for faster
implementations.
# Parameters
- memory: The memory to consider.
# Returns
True if the action is applicable (False otherwise).
# _is_enabled_event Events
_is_enabled_event(
self,
event: D.T_event,
memory: Optional[Memory[D.T_state]] = None
) -> bool
Indicate whether an uncontrollable event is enabled in the given memory (state or history), or in the internal one if omitted.
By default, Events._is_enabled_event()
provides some boilerplate code and internally
calls Events._is_enabled_event_from()
. The boilerplate code automatically passes the _memory
attribute instead
of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
True if the event is enabled (False otherwise).
# _is_enabled_event_from Events
_is_enabled_event_from(
self,
event: D.T_event,
memory: Memory[D.T_state]
) -> bool
Indicate whether an event is enabled in the given memory (state or history).
This is a helper function called by default from Events._is_enabled_event()
, the difference being that the
memory parameter is mandatory here.
TIP
By default, this function is implemented using the skdecide.core.Space.contains()
function on the space of
enabled events provided by Events._get_enabled_events_from()
, but it can be overridden for faster
implementations.
# Parameters
- memory: The memory to consider.
# Returns
True if the event is enabled (False otherwise).
# UnrestrictedActions
A domain must inherit this class if it handles only actions (i.e. controllable events), which are always all applicable.
# get_action_space Events
get_action_space(
self
) -> StrDict[Space[D.T_event]]
Get the (cached) domain action space (finite or infinite set).
By default, Events.get_action_space()
internally calls Events._get_action_space_()
the first time and
automatically caches its value to make future calls more efficient (since the action space is assumed to be
constant).
# Returns
The action space.
# get_applicable_actions Events
get_applicable_actions(
self,
memory: Optional[Memory[D.T_state]] = None
) -> StrDict[Space[D.T_event]]
Get the space (finite or infinite set) of applicable actions in the given memory (state or history), or in the internal one if omitted.
By default, Events.get_applicable_actions()
provides some boilerplate code and internally
calls Events._get_applicable_actions()
. The boilerplate code automatically passes the _memory
attribute
instead of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
The space of applicable actions.
# get_enabled_events Events
get_enabled_events(
self,
memory: Optional[Memory[D.T_state]] = None
) -> Space[D.T_event]
Get the space (finite or infinite set) of enabled uncontrollable events in the given memory (state or history), or in the internal one if omitted.
By default, Events.get_enabled_events()
provides some boilerplate code and internally
calls Events._get_enabled_events()
. The boilerplate code automatically passes the _memory
attribute instead of
the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
The space of enabled events.
# is_action Events
is_action(
self,
event: D.T_event
) -> bool
Indicate whether an event is an action (i.e. a controllable event for the agents).
TIP
By default, this function is implemented using the skdecide.core.Space.contains()
function on the domain
action space provided by Events.get_action_space()
, but it can be overridden for faster implementations.
# Parameters
- event: The event to consider.
# Returns
True if the event is an action (False otherwise).
# is_applicable_action Events
is_applicable_action(
self,
action: StrDict[D.T_event],
memory: Optional[Memory[D.T_state]] = None
) -> bool
Indicate whether an action is applicable in the given memory (state or history), or in the internal one if omitted.
By default, Events.is_applicable_action()
provides some boilerplate code and internally
calls Events._is_applicable_action()
. The boilerplate code automatically passes the _memory
attribute instead
of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
True if the action is applicable (False otherwise).
# is_enabled_event Events
is_enabled_event(
self,
event: D.T_event,
memory: Optional[Memory[D.T_state]] = None
) -> bool
Indicate whether an uncontrollable event is enabled in the given memory (state or history), or in the internal one if omitted.
By default, Events.is_enabled_event()
provides some boilerplate code and internally
calls Events._is_enabled_event()
. The boilerplate code automatically passes the _memory
attribute instead of
the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
True if the event is enabled (False otherwise).
# _get_action_space Events
_get_action_space(
self
) -> StrDict[Space[D.T_event]]
Get the (cached) domain action space (finite or infinite set).
By default, Events._get_action_space()
internally calls Events._get_action_space_()
the first time and
automatically caches its value to make future calls more efficient (since the action space is assumed to be
constant).
# Returns
The action space.
# _get_action_space_ Events
_get_action_space_(
self
) -> StrDict[Space[D.T_event]]
Get the domain action space (finite or infinite set).
This is a helper function called by default from Events._get_action_space()
, the difference being that the
result is not cached here.
TIP
The underscore at the end of this function's name is a convention to remind that its result should be constant.
# Returns
The action space.
# _get_applicable_actions Events
_get_applicable_actions(
self,
memory: Optional[Memory[D.T_state]] = None
) -> StrDict[Space[D.T_event]]
Get the space (finite or infinite set) of applicable actions in the given memory (state or history), or in the internal one if omitted.
By default, Events._get_applicable_actions()
provides some boilerplate code and internally
calls Events._get_applicable_actions_from()
. The boilerplate code automatically passes the _memory
attribute
instead of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
The space of applicable actions.
# _get_applicable_actions_from Events
_get_applicable_actions_from(
self,
memory: Memory[D.T_state]
) -> StrDict[Space[D.T_event]]
Get the space (finite or infinite set) of applicable actions in the given memory (state or history).
This is a helper function called by default from Events._get_applicable_actions()
, the difference being that
the memory parameter is mandatory here.
# Parameters
- memory: The memory to consider.
# Returns
The space of applicable actions.
# _get_enabled_events Events
_get_enabled_events(
self,
memory: Optional[Memory[D.T_state]] = None
) -> Space[D.T_event]
Get the space (finite or infinite set) of enabled uncontrollable events in the given memory (state or history), or in the internal one if omitted.
By default, Events._get_enabled_events()
provides some boilerplate code and internally
calls Events._get_enabled_events_from()
. The boilerplate code automatically passes the _memory
attribute
instead of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
The space of enabled events.
# _get_enabled_events_from Events
_get_enabled_events_from(
self,
memory: Memory[D.T_state]
) -> Space[D.T_event]
Get the space (finite or infinite set) of enabled uncontrollable events in the given memory (state or history).
This is a helper function called by default from Events._get_enabled_events()
, the difference being that the
memory parameter is mandatory here.
# Parameters
- memory: The memory to consider.
# Returns
The space of enabled events.
# _is_action Events
_is_action(
self,
event: D.T_event
) -> bool
Indicate whether an event is an action (i.e. a controllable event for the agents).
TIP
By default, this function is implemented using the skdecide.core.Space.contains()
function on the domain
action space provided by Events._get_action_space()
, but it can be overridden for faster implementations.
# Parameters
- event: The event to consider.
# Returns
True if the event is an action (False otherwise).
# _is_applicable_action Events
_is_applicable_action(
self,
action: StrDict[D.T_event],
memory: Optional[Memory[D.T_state]] = None
) -> bool
Indicate whether an action is applicable in the given memory (state or history), or in the internal one if omitted.
By default, Events._is_applicable_action()
provides some boilerplate code and internally
calls Events._is_applicable_action_from()
. The boilerplate code automatically passes the _memory
attribute
instead of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
True if the action is applicable (False otherwise).
# _is_applicable_action_from Events
_is_applicable_action_from(
self,
action: StrDict[D.T_event],
memory: Memory[D.T_state]
) -> bool
Indicate whether an action is applicable in the given memory (state or history).
This is a helper function called by default from Events._is_applicable_action()
, the difference being that the
memory parameter is mandatory here.
TIP
By default, this function is implemented using the skdecide.core.Space.contains()
function on the space of
applicable actions provided by Events._get_applicable_actions_from()
, but it can be overridden for faster
implementations.
# Parameters
- memory: The memory to consider.
# Returns
True if the action is applicable (False otherwise).
# _is_enabled_event Events
_is_enabled_event(
self,
event: D.T_event,
memory: Optional[Memory[D.T_state]] = None
) -> bool
Indicate whether an uncontrollable event is enabled in the given memory (state or history), or in the internal one if omitted.
By default, Events._is_enabled_event()
provides some boilerplate code and internally
calls Events._is_enabled_event_from()
. The boilerplate code automatically passes the _memory
attribute instead
of the memory parameter whenever the latter is None.
# Parameters
- memory: The memory to consider (if None, the internal memory attribute
_memory
is used instead).
# Returns
True if the event is enabled (False otherwise).
# _is_enabled_event_from Events
_is_enabled_event_from(
self,
event: D.T_event,
memory: Memory[D.T_state]
) -> bool
Indicate whether an event is enabled in the given memory (state or history).
This is a helper function called by default from Events._is_enabled_event()
, the difference being that the
memory parameter is mandatory here.
TIP
By default, this function is implemented using the skdecide.core.Space.contains()
function on the space of
enabled events provided by Events._get_enabled_events_from()
, but it can be overridden for faster
implementations.
# Parameters
- memory: The memory to consider.
# Returns
True if the event is enabled (False otherwise).