MAPDDLWriter
- class unified_planning.io.MAPDDLWriter(problem: MultiAgentProblem, explicit_false_initial_states: bool | None = False, unfactored: bool | None = False, needs_requirements: bool = True, rewrite_bool_assignments: bool = False)[source]
Bases:
objectThis class can be used to write a
MultiAgentProblemin MA-PDDL. The constructor of this class takes the problem to write and 4 flags:explicit_false_initial_statesdetermines if this writer includes initially false predicates in the problem:init,unfactoredwhenFalsethis writer prints a domain and a problem for every agent, ifTruegenerates a single domain and a single problem,needs_requirementsdetermines if the printed problem must have the :requirements,rewrite_bool_assignmentsdetermines if this writer will write non constant boolean assignment as conditional effects.
- get_predicates_functions(obj: Agent | MAEnvironment, is_private: bool = False)[source]
- get_item_named(name: str) Type | Action | NaturalTransition | Fluent | Object | Parameter | Variable | Agent | Method | Task[source]
Since MA-PDDL has a stricter set of possible naming compared to the unified_planning, when writing a
Problemit is possible that some things must be renamed. This is why the MAPDDLWriter offers this method, that takes a MA-PDDL name and returns the original unified_planning data structure that corresponds to the MA-PDDL entity with the given name.This method takes a name used in the MA-PDDL domain or MA-PDDL problem generated by this MAPDDLWriter and returns the original item in the unified_planning Problem.
- Parameters:
name – The name used in the generated MA-PDDL.
- Returns:
The unified_planning model entity corresponding to the given name.
- get_ma_pddl_name(item: Type | Action | Fluent | Object | Parameter | Variable) str[source]
This method takes an item in the
MultiAgentProblemand returns the chosen name for the same item in the MA-PDDL problem or MA-PDDL domain generated by this MAPDDLWriter.- Parameters:
item – The unified_planning entity renamed by this MAPDDLWriter.
- Returns:
The MA-PDDL name of the given item.