concepts.dm.crow.behavior.CrowEffectApplier#

class CrowEffectApplier[source]#

Bases: object

An effect applier is a wrapper around a behavior/controller that represents the application of the effects of a behavior or a controller.

Recall that in CDL, the effects (updates to the planner state) is not associated with the controller itself, but higher-level behaviors. Therefore, we can not directly track the state updates if we only have a sequence of controller function applications. To address this issue, we introduce the concept of effect applier.

At planning time, if the option include_effect_appliers is set to True, in the generated controller_actions list, we will include both the controller applications and the effect appliers, indicating the time when the state updates happens. The effect applier data structure records the statements that updates the state in the planning world and the bounded_variables that is used to execute the statements.

To execute an effect applier based on a state, we can call:

executor = ...
state = ...
effect_applier = ...

from concepts.dm.crow.behavior_utils import execute_effect_applier
execute_effect_applier(executor, effect_applier, state)

To pretty print an effect applier, we simply call str(effect_applier).

The cdl-plan tool also provides a command –print-effect-appliers. If this flag is set, the tool will print the effect appliers in the generated plan.

cdl-plan blocksworld-problem-sussman-with-pragma.cdl --print-effect-appliers

Methods

__init__(statements, bounded_variables)[source]#
Parameters:
__new__(**kwargs)#