Decisions
Decision class of actor.
Source code in abses/decision.py
name
classmethod
property
¶
Get the name of the decision.
By default, this will be a snake name of class name.
Users can custom it by assigning a class attribute name_as
.
validate_strategies
classmethod
¶
Check if the strategies valid.
Source code in abses/decision.py
set_strategies
classmethod
¶
making
classmethod
¶
A decorator makes this decision.
Source code in abses/decision.py
response
classmethod
¶
Change the decorated function into a response methods.
Source code in abses/decision.py
validate_decision_maker
classmethod
¶
Validate maker of this decision.
Source code in abses/decision.py
validate_strategy
classmethod
¶
Validate a strategy choice.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
strategy |
Strategy
|
The strategy to validate. |
required |
Raises:
Type | Description |
---|---|
KeyError
|
If the strategy is not a valid choice. |
Source code in abses/decision.py
has_strategy
classmethod
¶
Is a specific strategy existing in this decision?
Parameters:
Name | Type | Description | Default |
---|---|---|---|
strategy |
Strategy
|
The strategy to validate. |
required |
Returns:
Type | Description |
---|---|
bool
|
If the strategy exists, return True, otherwise returns False. |
Source code in abses/decision.py
setup ¶
Creating and containing decisions of an agent.
Source code in abses/decision.py
parse_decisions ¶
Parse decisions and save into the container.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
decisions |
Iterable[Type[Decision]]
|
Iterable |
required |
Raises:
Type | Description |
---|---|
TypeError
|
If the input decision is not a subclass of |