agents.rules package
Attention
All rules should be imported into this module for LunaticAgentSettings.rules
to work. As hydra.instantiate needs the variables in this file or an absolute path.
- agents.rules.create_default_rules(gameframework: GameFramework | None = None, random_lane_change: bool = False) Iterable[Rule][source]
- Parameters:
gameframework (GameFramework | None)
random_lane_change (bool)
- Return type:
Iterable[Rule]
- agents.rules.rule_from_config(cfg: CallFunctionFromConfig | DictConfig | CreateRuleFromConfig) Rule | Iterable[Rule][source]
Instantiates Rules through Hydra’s instantiate function.
Note
The _target_ interface also allows to call functions, e.g.
create_default_rules(), hence you need to check if the return value is a Rule or an Iterable[Rule]- Returns:
Rule or Iterable[Rule]
- Parameters:
cfg (CallFunctionFromConfig | DictConfig | CreateRuleFromConfig)
- Return type:
Subpackages
Submodules
agents.rules.behaviour_templates module
- agents.rules.behaviour_templates.if_config(config_path, value)[source]
Returns a partial function that checks if a value in the config is set to a certain value.
- agents.rules.behaviour_templates.set_default_intersection_speed(ctx: classes.rule.Context)[source]
Slow down the car when turning at a junction.
- Parameters:
ctx (classes.rule.Context)
- class agents.rules.behaviour_templates.SlowDownAtIntersectionRule(phases: Phase | Iterable[Phase] | 'type[Any]' | Self | str | None | None = None, bases: tuple[type[Any], ...] | None = None, clsdict: dict[str, Any] | None = None, **kwargs: Any)[source]
Bases:
RuleSlow down the car when turning at a junction.
- Parameters:
condition (Optional[ConditionFunctionLikeT])
action (Optional[Union[CallableAction[Self, []], Dict[Any, CallableAction[Self, []]]]])
false_action (Optional[CallableAction[Self, []]])
actions (Optional[Dict[Any, CallableAction[Self, []]]])
description (str)
priority (RulePriority)
cooldown_reset_value (Optional[int])
group (Optional[str])
enabled (bool)
- condition()
This is an
ConditionFunctionthat always returnsTrue. It can be used to always execute an action.
- action()
Slow down the car when turning at a junction.
- Parameters:
ctx (classes.rule.Context)
- overwrite_settings: dict[str, Any] = {'speed': {'intersection_speed_decrease': 10}}
Settings that should overwrite the agent’s settings for this rule.
Note
The overwrite settings are primitive
dictobjects,omegaconf.DictConfigobjects are converted.
- __init__(phases: Phase | Iterable[Phase], condition: ConditionFunctionLikeT | None = None, action: CallableActionT | Dict[Any, CallableActionT] | None = None, false_action: CallableActionT | None = None, *, actions: Dict[Any, CallableActionT] | None = None, description: str = 'What does this rule do?', overwrite_settings: Dict[str, Any] | None = None, self_config: Dict[str, Any] | None = None, priority: RulePriority = RulePriority.NORMAL, cooldown_reset_value: int | None = None, group: str | None = None, enabled: bool = True)
Initializes a Rule object.
- Parameters:
phases (Union[Phase, Iterable[Phase]]) – The phase(s) when the rule should be evaluated. An iterable of Phase objects or a single Phase object.
condition (Optional[ConditionFunctionLikeT]) – A function that takes a Context object as input and returns a Hashable value. If not provided, the class must implement a condition function.
action (Optional[Union[CallableActionT, Dict[Any, CallableActionT]]]) – A function or a dictionary of functions that take a Context object as input. If action behaves like actions. Only one of action and actions can be set.
false_action (Optional[CallableActionT]) – A function that takes a Context object as input and returns any value. It is used when action is a single function and represents the action to be taken when the condition is False.
actions (Optional[Dict[Any, CallableActionT]]) – A dictionary of action functions It should map the return values of condition to the corresponding action function. If action is None, actions must be provided.
description (str) – A string that describes what this rule does.
overwrite_settings (Optional[Dict[str, Any]]) – A dictionary of settings that will overwrite the agent’s setting for this Rule.
priority (RulePriority) – The priority of the rule. It can be a float, an integer, or a RulePriority enum value.
cooldown_reset_value (Optional[int]) – An optional integer value that represents the cooldown reset value for the rule. If not provided falls back to the class attribute
Rule.DEFAULT_COOLDOWN_RESET.group (Optional[str]) – An optional string that specifies the group to which this rule belongs.
enabled (bool) – A boolean value indicating whether the rule is enabled or not.
- Raises:
ValueError – If
phasesis empty or None, or ifphasescontains an object that is not of type Phase.TypeError – If
conditionis None and the class does not implement acondition()function, or if bothactionandactionsare None and the class does not have anactionsattribute or anaction()function.TypeError – if
actionsis not a Mapping object.ValueError – If both
actionandactionsare provided.ValueError – If
actionis a Mapping and eitherfalse_actionoractionsis not None.ValueError – If an
actionfunction is not callable.ValueError – If
descriptionis not a string.
- agents.rules.behaviour_templates.set_default_speed(ctx: classes.rule.Context)[source]
Speed to apply when the car drives under normal circumstances, i.e. no junctions, no obstacles, etc. detected.
- Parameters:
ctx (classes.rule.Context)
- class agents.rules.behaviour_templates.NormalSpeedRule(phases: Phase | Iterable[Phase] | 'type[Any]' | Self | str | None | None = None, bases: tuple[type[Any], ...] | None = None, clsdict: dict[str, Any] | None = None, **kwargs: Any)[source]
Bases:
RuleSpeed to apply when the car drives under normal circumstances, i.e. no junctions, no obstacles, etc. detected.
- Parameters:
condition (Optional[ConditionFunctionLikeT])
action (Optional[Union[CallableActionT, Dict[Any, CallableActionT]]])
false_action (Optional[CallableActionT])
actions (Optional[Dict[Any, CallableActionT]])
description (str)
priority (RulePriority)
cooldown_reset_value (Optional[int])
group (Optional[str])
enabled (bool)
- phases: frozenset[Phase] = 257
The phase or phases in which the rule should be evaluated. For instantiation the phases attribute can be any Iterable [
Phase].
- condition()
This is an
ConditionFunctionthat always returnsTrue. It can be used to always execute an action.
- action()
Speed to apply when the car drives under normal circumstances, i.e. no junctions, no obstacles, etc. detected.
- Parameters:
ctx (classes.rule.Context)
- __init__(phases: Phase | Iterable[Phase], condition: ConditionFunctionLikeT | None = None, action: CallableActionT | Dict[Any, CallableActionT] | None = None, false_action: CallableActionT | None = None, *, actions: Dict[Any, CallableActionT] | None = None, description: str = 'What does this rule do?', overwrite_settings: Dict[str, Any] | None = None, self_config: Dict[str, Any] | None = None, priority: RulePriority = RulePriority.NORMAL, cooldown_reset_value: int | None = None, group: str | None = None, enabled: bool = True)
Initializes a Rule object.
- Parameters:
phases (Union[Phase, Iterable[Phase]]) – The phase(s) when the rule should be evaluated. An iterable of Phase objects or a single Phase object.
condition (Optional[ConditionFunctionLikeT]) – A function that takes a Context object as input and returns a Hashable value. If not provided, the class must implement a condition function.
action (Optional[Union[CallableActionT, Dict[Any, CallableActionT]]]) – A function or a dictionary of functions that take a Context object as input. If action behaves like actions. Only one of action and actions can be set.
false_action (Optional[CallableActionT]) – A function that takes a Context object as input and returns any value. It is used when action is a single function and represents the action to be taken when the condition is False.
actions (Optional[Dict[Any, CallableActionT]]) – A dictionary of action functions It should map the return values of condition to the corresponding action function. If action is None, actions must be provided.
description (str) – A string that describes what this rule does.
overwrite_settings (Optional[Dict[str, Any]]) – A dictionary of settings that will overwrite the agent’s setting for this Rule.
priority (RulePriority) – The priority of the rule. It can be a float, an integer, or a RulePriority enum value.
cooldown_reset_value (Optional[int]) – An optional integer value that represents the cooldown reset value for the rule. If not provided falls back to the class attribute
Rule.DEFAULT_COOLDOWN_RESET.group (Optional[str]) – An optional string that specifies the group to which this rule belongs.
enabled (bool) – A boolean value indicating whether the rule is enabled or not.
- Raises:
ValueError – If
phasesis empty or None, or ifphasescontains an object that is not of type Phase.TypeError – If
conditionis None and the class does not implement acondition()function, or if bothactionandactionsare None and the class does not have anactionsattribute or anaction()function.TypeError – if
actionsis not a Mapping object.ValueError – If both
actionandactionsare provided.ValueError – If
actionis a Mapping and eitherfalse_actionoractionsis not None.ValueError – If an
actionfunction is not callable.ValueError – If
descriptionis not a string.
- agents.rules.behaviour_templates.random_spawnpoint_destination(ctx: classes.rule.Context, waypoints: List[carla.Waypoint] | None = None)[source]
Set a random waypoint as the next target.
- Parameters:
ctx (classes.rule.Context)
waypoints (List[carla.Waypoint] | None)
- class agents.rules.behaviour_templates.TargetRandomSpawnpointWhenDone(phases: Phase | Iterable[Phase] | 'type[Any]' | Self | str | None | None = None, bases: tuple[type[Any], ...] | None = None, clsdict: dict[str, Any] | None = None, **kwargs: Any)[source]
Bases:
RuleSets random waypoint when done
- Parameters:
condition (Optional[ConditionFunctionLikeT])
action (Optional[Union[CallableActionT, Dict[Any, CallableActionT]]])
false_action (Optional[CallableActionT])
actions (Optional[Dict[Any, CallableActionT]])
description (str)
priority (RulePriority)
cooldown_reset_value (Optional[int])
group (Optional[str])
enabled (bool)
- phases: frozenset[Phase] = 131073
The phase or phases in which the rule should be evaluated. For instantiation the phases attribute can be any Iterable [
Phase].
- condition()
Agent has reached its destination.
- action(waypoints: List[carla.Waypoint] | None = None)
Set a random waypoint as the next target.
- Parameters:
ctx (classes.rule.Context)
waypoints (List[carla.Waypoint] | None)
- __init__(phases: Phase | Iterable[Phase], condition: ConditionFunctionLikeT | None = None, action: CallableActionT | Dict[Any, CallableActionT] | None = None, false_action: CallableActionT | None = None, *, actions: Dict[Any, CallableActionT] | None = None, description: str = 'What does this rule do?', overwrite_settings: Dict[str, Any] | None = None, self_config: Dict[str, Any] | None = None, priority: RulePriority = RulePriority.NORMAL, cooldown_reset_value: int | None = None, group: str | None = None, enabled: bool = True)
Initializes a Rule object.
- Parameters:
phases (Union[Phase, Iterable[Phase]]) – The phase(s) when the rule should be evaluated. An iterable of Phase objects or a single Phase object.
condition (Optional[ConditionFunctionLikeT]) – A function that takes a Context object as input and returns a Hashable value. If not provided, the class must implement a condition function.
action (Optional[Union[CallableActionT, Dict[Any, CallableActionT]]]) – A function or a dictionary of functions that take a Context object as input. If action behaves like actions. Only one of action and actions can be set.
false_action (Optional[CallableActionT]) – A function that takes a Context object as input and returns any value. It is used when action is a single function and represents the action to be taken when the condition is False.
actions (Optional[Dict[Any, CallableActionT]]) – A dictionary of action functions It should map the return values of condition to the corresponding action function. If action is None, actions must be provided.
description (str) – A string that describes what this rule does.
overwrite_settings (Optional[Dict[str, Any]]) – A dictionary of settings that will overwrite the agent’s setting for this Rule.
priority (RulePriority) – The priority of the rule. It can be a float, an integer, or a RulePriority enum value.
cooldown_reset_value (Optional[int]) – An optional integer value that represents the cooldown reset value for the rule. If not provided falls back to the class attribute
Rule.DEFAULT_COOLDOWN_RESET.group (Optional[str]) – An optional string that specifies the group to which this rule belongs.
enabled (bool) – A boolean value indicating whether the rule is enabled or not.
- Raises:
ValueError – If
phasesis empty or None, or ifphasescontains an object that is not of type Phase.TypeError – If
conditionis None and the class does not implement acondition()function, or if bothactionandactionsare None and the class does not have anactionsattribute or anaction()function.TypeError – if
actionsis not a Mapping object.ValueError – If both
actionandactionsare provided.ValueError – If
actionis a Mapping and eitherfalse_actionoractionsis not None.ValueError – If an
actionfunction is not callable.ValueError – If
descriptionis not a string.
- agents.rules.behaviour_templates.set_next_waypoint_nearby(ctx: classes.rule.Context)[source]
- Parameters:
ctx (classes.rule.Context)
- class agents.rules.behaviour_templates.SetNextWaypointNearby(phases: Phase | Iterable[Phase] | 'type[Any]' | Self | str | None | None = None, bases: tuple[type[Any], ...] | None = None, clsdict: dict[str, Any] | None = None, **kwargs: Any)[source]
Bases:
RuleSets random waypoint when done to a nearby point ahead
- Parameters:
condition (Optional[ConditionFunctionLikeT])
action (Optional[Union[CallableActionT, Dict[Any, CallableActionT]]])
false_action (Optional[CallableActionT])
actions (Optional[Dict[Any, CallableActionT]])
description (str)
priority (RulePriority)
cooldown_reset_value (Optional[int])
group (Optional[str])
enabled (bool)
- phases: frozenset[Phase] = 131073
The phase or phases in which the rule should be evaluated. For instantiation the phases attribute can be any Iterable [
Phase].
- condition()
Agent has reached its destination.
- action()
- Parameters:
ctx (classes.rule.Context)
- __init__(phases: Phase | Iterable[Phase], condition: ConditionFunctionLikeT | None = None, action: CallableActionT | Dict[Any, CallableActionT] | None = None, false_action: CallableActionT | None = None, *, actions: Dict[Any, CallableActionT] | None = None, description: str = 'What does this rule do?', overwrite_settings: Dict[str, Any] | None = None, self_config: Dict[str, Any] | None = None, priority: RulePriority = RulePriority.NORMAL, cooldown_reset_value: int | None = None, group: str | None = None, enabled: bool = True)
Initializes a Rule object.
- Parameters:
phases (Union[Phase, Iterable[Phase]]) – The phase(s) when the rule should be evaluated. An iterable of Phase objects or a single Phase object.
condition (Optional[ConditionFunctionLikeT]) – A function that takes a Context object as input and returns a Hashable value. If not provided, the class must implement a condition function.
action (Optional[Union[CallableActionT, Dict[Any, CallableActionT]]]) – A function or a dictionary of functions that take a Context object as input. If action behaves like actions. Only one of action and actions can be set.
false_action (Optional[CallableActionT]) – A function that takes a Context object as input and returns any value. It is used when action is a single function and represents the action to be taken when the condition is False.
actions (Optional[Dict[Any, CallableActionT]]) – A dictionary of action functions It should map the return values of condition to the corresponding action function. If action is None, actions must be provided.
description (str) – A string that describes what this rule does.
overwrite_settings (Optional[Dict[str, Any]]) – A dictionary of settings that will overwrite the agent’s setting for this Rule.
priority (RulePriority) – The priority of the rule. It can be a float, an integer, or a RulePriority enum value.
cooldown_reset_value (Optional[int]) – An optional integer value that represents the cooldown reset value for the rule. If not provided falls back to the class attribute
Rule.DEFAULT_COOLDOWN_RESET.group (Optional[str]) – An optional string that specifies the group to which this rule belongs.
enabled (bool) – A boolean value indicating whether the rule is enabled or not.
- Raises:
ValueError – If
phasesis empty or None, or ifphasescontains an object that is not of type Phase.TypeError – If
conditionis None and the class does not implement acondition()function, or if bothactionandactionsare None and the class does not have anactionsattribute or anaction()function.TypeError – if
actionsis not a Mapping object.ValueError – If both
actionandactionsare provided.ValueError – If
actionis a Mapping and eitherfalse_actionoractionsis not None.ValueError – If an
actionfunction is not callable.ValueError – If
descriptionis not a string.
- agents.rules.behaviour_templates.accept_rss_updates(ctx: Context)[source]
Accept RSS updates from the RSS manager.
- Parameters:
ctx (Context)
- class agents.rules.behaviour_templates.AlwaysAcceptRSSUpdates(phases: Phase | Iterable[Phase] | 'type[Any]' | Self | str | None | None = None, bases: tuple[type[Any], ...] | None = None, clsdict: dict[str, Any] | None = None, **kwargs: Any)[source]
Bases:
RuleAlways accept RSS updates if rss is enabled in the config.
- Parameters:
condition (Optional[ConditionFunctionLikeT])
action (Optional[Union[CallableActionT, Dict[Any, CallableActionT]]])
false_action (Optional[CallableActionT])
actions (Optional[Dict[Any, CallableActionT]])
description (str)
priority (RulePriority)
cooldown_reset_value (Optional[int])
group (Optional[str])
enabled (bool)
- phases: frozenset[Phase] = 514
The phase or phases in which the rule should be evaluated. For instantiation the phases attribute can be any Iterable [
Phase].
- condition()
Check if a value in the config is set to a certain value.
- description: str = 'Always accepts the updates calculated by the RSS System.'
Description of what this rule should do
- __init__(phases: Phase | Iterable[Phase], condition: ConditionFunctionLikeT | None = None, action: CallableActionT | Dict[Any, CallableActionT] | None = None, false_action: CallableActionT | None = None, *, actions: Dict[Any, CallableActionT] | None = None, description: str = 'What does this rule do?', overwrite_settings: Dict[str, Any] | None = None, self_config: Dict[str, Any] | None = None, priority: RulePriority = RulePriority.NORMAL, cooldown_reset_value: int | None = None, group: str | None = None, enabled: bool = True)
Initializes a Rule object.
- Parameters:
phases (Union[Phase, Iterable[Phase]]) – The phase(s) when the rule should be evaluated. An iterable of Phase objects or a single Phase object.
condition (Optional[ConditionFunctionLikeT]) – A function that takes a Context object as input and returns a Hashable value. If not provided, the class must implement a condition function.
action (Optional[Union[CallableActionT, Dict[Any, CallableActionT]]]) – A function or a dictionary of functions that take a Context object as input. If action behaves like actions. Only one of action and actions can be set.
false_action (Optional[CallableActionT]) – A function that takes a Context object as input and returns any value. It is used when action is a single function and represents the action to be taken when the condition is False.
actions (Optional[Dict[Any, CallableActionT]]) – A dictionary of action functions It should map the return values of condition to the corresponding action function. If action is None, actions must be provided.
description (str) – A string that describes what this rule does.
overwrite_settings (Optional[Dict[str, Any]]) – A dictionary of settings that will overwrite the agent’s setting for this Rule.
priority (RulePriority) – The priority of the rule. It can be a float, an integer, or a RulePriority enum value.
cooldown_reset_value (Optional[int]) – An optional integer value that represents the cooldown reset value for the rule. If not provided falls back to the class attribute
Rule.DEFAULT_COOLDOWN_RESET.group (Optional[str]) – An optional string that specifies the group to which this rule belongs.
enabled (bool) – A boolean value indicating whether the rule is enabled or not.
- Raises:
ValueError – If
phasesis empty or None, or ifphasescontains an object that is not of type Phase.TypeError – If
conditionis None and the class does not implement acondition()function, or if bothactionandactionsare None and the class does not have anactionsattribute or anaction()function.TypeError – if
actionsis not a Mapping object.ValueError – If both
actionandactionsare provided.ValueError – If
actionis a Mapping and eitherfalse_actionoractionsis not None.ValueError – If an
actionfunction is not callable.ValueError – If
descriptionis not a string.
- class agents.rules.behaviour_templates.ConfigBasedRSSUpdates(phases: Phase | Iterable[Phase] | 'type[Any]' | Self | str | None | None = None, bases: tuple[type[Any], ...] | None = None, clsdict: dict[str, Any] | None = None, **kwargs: Any)[source]
Bases:
RuleAlways accept RSS updates if
rss.always_accept_updateis set to True in the config.- Parameters:
condition (Optional[ConditionFunctionLikeT])
action (Optional[Union[CallableActionT, Dict[Any, CallableActionT]]])
false_action (Optional[CallableActionT])
actions (Optional[Dict[Any, CallableActionT]])
description (str)
priority (RulePriority)
cooldown_reset_value (Optional[int])
group (Optional[str])
enabled (bool)
- phases: frozenset[Phase] = 514
The phase or phases in which the rule should be evaluated. For instantiation the phases attribute can be any Iterable [
Phase].
- condition()
Check if a value in the config is set to a certain value.
- __init__(phases: Phase | Iterable[Phase], condition: ConditionFunctionLikeT | None = None, action: CallableActionT | Dict[Any, CallableActionT] | None = None, false_action: CallableActionT | None = None, *, actions: Dict[Any, CallableActionT] | None = None, description: str = 'What does this rule do?', overwrite_settings: Dict[str, Any] | None = None, self_config: Dict[str, Any] | None = None, priority: RulePriority = RulePriority.NORMAL, cooldown_reset_value: int | None = None, group: str | None = None, enabled: bool = True)
Initializes a Rule object.
- Parameters:
phases (Union[Phase, Iterable[Phase]]) – The phase(s) when the rule should be evaluated. An iterable of Phase objects or a single Phase object.
condition (Optional[ConditionFunctionLikeT]) – A function that takes a Context object as input and returns a Hashable value. If not provided, the class must implement a condition function.
action (Optional[Union[CallableActionT, Dict[Any, CallableActionT]]]) – A function or a dictionary of functions that take a Context object as input. If action behaves like actions. Only one of action and actions can be set.
false_action (Optional[CallableActionT]) – A function that takes a Context object as input and returns any value. It is used when action is a single function and represents the action to be taken when the condition is False.
actions (Optional[Dict[Any, CallableActionT]]) – A dictionary of action functions It should map the return values of condition to the corresponding action function. If action is None, actions must be provided.
description (str) – A string that describes what this rule does.
overwrite_settings (Optional[Dict[str, Any]]) – A dictionary of settings that will overwrite the agent’s setting for this Rule.
priority (RulePriority) – The priority of the rule. It can be a float, an integer, or a RulePriority enum value.
cooldown_reset_value (Optional[int]) – An optional integer value that represents the cooldown reset value for the rule. If not provided falls back to the class attribute
Rule.DEFAULT_COOLDOWN_RESET.group (Optional[str]) – An optional string that specifies the group to which this rule belongs.
enabled (bool) – A boolean value indicating whether the rule is enabled or not.
- Raises:
ValueError – If
phasesis empty or None, or ifphasescontains an object that is not of type Phase.TypeError – If
conditionis None and the class does not implement acondition()function, or if bothactionandactionsare None and the class does not have anactionsattribute or anaction()function.TypeError – if
actionsis not a Mapping object.ValueError – If both
actionandactionsare provided.ValueError – If
actionis a Mapping and eitherfalse_actionoractionsis not None.ValueError – If an
actionfunction is not callable.ValueError – If
descriptionis not a string.
agents.rules.stopped_long_trigger module
Example of a MultiRule if the agent does not perform any actions for a certain time.
- class agents.rules.stopped_long_trigger.StoppedTooLongTrigger(phases: Phase | Iterable[Phase] | 'type[Any]' | Self | str | None | None = None, bases: tuple[type[Any], ...] | None = None, clsdict: dict[str, Any] | None = None, **kwargs: Any)[source]
Bases:
MultiRuleTriggers child rules if the agent has stopped for a too long time
- Parameters:
rules (List[Rule])
condition (Optional[ConditionFunctionLikeT])
description (str)
priority (RulePriority)
sort_rules (bool)
execute_all_rules (bool)
ignore_phase (bool)
cooldown_reset_value (Optional[int])
group (Optional[str])
enabled (bool)
- stop_time_threshold = 60
Time in seconds the agent is allowed to stop before triggering the rule.
- __init__(phases: Phase | Iterable[Phase], rules: List[Rule], condition: ConditionFunctionLikeT | None = None, *, description: str = 'If its own condition is true calls the passed rules.', priority: RulePriority = RulePriority.NORMAL, sort_rules: bool = True, execute_all_rules: bool = False, action: Callable[[Context], Any] | None = None, ignore_phase: bool = True, overwrite_settings: Dict[str, Any] | None = None, self_config: Dict[str, Any] | None = None, cooldown_reset_value: int | None = None, group: str | None = None, enabled: bool = True)
Initializes a Rule object that can have further rules as children.
- Parameters:
phases (
Union[Phase, Iterable]) – The phase or phases in which the rule should be active.rules (
List[Rule]) – The list of child rules to be called if the rule’s condition is true.condition (
Callable[[Context]], optional) – The condition that determines if the rules should be evaluated. Defaults toalways_execute().execute_all_rules (
bool, optional) – If False will only execute the first rule with a applicable condition, i.e. this MultiRule is like a node in a decision tree. If True all rules are evaluated, unless one raises a DoNotEvaluateChildRules exception. Defaults toFalse.sort_rules (
bool, optional) – Flag indicating whether to sort the rules by priority. Defaults toTrue.action (
Callable[[Context]], optional) – The action to be executed before the passed rules are evaluated. Defaults toNone.ignore_phase (
bool, optional) – Flag indicating whether to ignore the Phase of the passed child rules. Defaults toTrue.overwrite_settings (
Dict[str, Any], optional) – Additional settings to overwrite the agent’s settings. Defaults toNone.priority (
RulePriority, optional) – The priority of the rule.RulePriority.NORMAL.description (
str, optional) – The description of the rule. Defaults to"If its own rule is true calls the passed rules.".group (
str | None, optional) – The group name of the rule. Defaults toNone.enabled (
bool, optional) – Flag indicating whether the rule is enabled after creation. Defaults toTrue.cooldown_reset_value (Optional[int])