Blocksworld codes1/20/2024 ![]() PDDL.jl also supports compiled action semantics, generating specialized implementations of the execute and available interface functions for each action schema in the domain. This is why the compiled function requires either the problem or initial state as an input. Generating a compiled state representation requires knowing the number of objects in the problem, their types, and their names. Together, this leads to much lower memory consumption and access times: CompiledBlocksworldState Furthermore, each bit array is a field with a fixed name in the compiled data structure. Predicate values are stored in memory-efficient bit-arrays, with dimensionality corresponding to the arity of each predicate (1 dimension for (holding ?x), 2 dimensions for (on ?x ?y)). ![]() In constrast, the compiled state representation is shown below. This consumes a fair amount of memory, and suffers from hashing overhead when looking up the value of a fluent: GenericState The generic state representation used by the PDDL.jl interpreter stores all Boolean fluents in a Set data structure, and non-Boolean fluents in a Dict. To illustrate the benefits of state compilation, consider the initial state of a Blocksworld problem with 3 blocks, as shown in the Getting Started tutorial. These representations take advantage of the fixed number of objects in standard PDDL problems, allowing for the generation of finite-object state representations with a known size in advance. One way in which the PDDL.jl compiler reduces runtime is by generating compiled state representations that compactly represent the set of facts and fluent values in a state. # Check that the goal is achieved in the final satisfy(c_domain, c_state, goal)įactoring out the initial cost of Julia's just-ahead-of-time compilation, planning over the compiled domain and state should lead to runtimes that are 10 times faster or more, compared to the PDDL.jl interpreter. # Execute resulting plan on the compiled initial stateĬ_state = transition(c_domain, c_state, act) ![]() # Call A* search on compiled domain and initial state The compiled outputs c_domain and c_state can then be used with the PDDL.jl interface, or with an existing planner from SymbolicPlanners.jl: using SymbolicPlanners # Compile the domain and state to get a compiled domain and stateĬ_domain, c_state = compiled(domain, state) # Compile the domain and problem to get a compiled domain and stateĬ_domain, c_state = compiled(domain, problem)Īlternatively, compiled can be called on a non-compiled domain and (initial) state: # Construct initial state from domain and problem Problem = load_problem(:blocksworld, "problem-10") # Load a generic representation of PDDL domain and problem This returns a compiled domain and initial state: using PDDL, PlanningDomains To use the PDDL compiler, just call the compiled function on a PDDL domain and problem. In this tutorial, we show how to use the PDDL compiler to speed up planning algorithms, and explain how these speed-ups are achieved. As can be seen in the (log-scale) graph above, using the compiler to solve Blocksworld problems is 10 times faster than the interpreter, within an order of magnitude of the state-of-the-art FastDownward planner, and 20 times faster than Pyperplan, a Python-based planning system. baselines, each using A* search with the additive heuristic.įortunately, PDDL.jl also provides a PDDL compiler that is optimized for speed and low memory consumption. Blocksworld solution times for PDDL.jl vs. However, because the interpreter is not optimized for speed, planning algorithms that use the interpreter are considerably slower than state-of-the-art planners. By default, PDDL.jl uses the built-in PDDL interpreter to execute actions, determine the set of available actions, and perform other basic planning operations.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |