Code Monkey home page Code Monkey logo

Comments (2)

ztangent avatar ztangent commented on July 16, 2024

It's undocumented, but you use this function to get an iterator over all possible arguments for a predicate / fluent!

"Returns an iterator over all ground arguments of a `fluent`."
function groundargs(domain::Domain, state::State, fluent::Symbol)
if get_requirements(domain)[:typing]
argtypes = get_fluent(domain, fluent).argtypes
obj_iters = (get_objects(domain, state, ty) for ty in argtypes)
else
n = arity(get_fluent(domain, fluent))
obj_iters = (get_objects(state) for i in 1:n)
end
return Iterators.product(obj_iters...)
end

This doesn't do any relevance checking though. If you want the list of all "planning-relevant-ground-predicates", you can construct a GraphPlan-style planning graph using this function, and then access the conditions field.:

https://github.com/JuliaPlanners/SymbolicPlanners.jl/blob/c2c83e06e826dae3fae53a7e257d0df158a8d0c0/src/heuristics/pgraph.jl#L17-L27

from pddl.jl.

ztangent avatar ztangent commented on July 16, 2024

Hopefully this resolved your issue! Moving this to the Q&A section of the Discussions page.

from pddl.jl.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.