Coder Social home page Coder Social logo

Comments (7)

alvalentini avatar alvalentini commented on August 29, 2024 1

This is due to the fact that we changed the way you can create a Fluent.
Now you have to specify also the name of the parameters, not only the type.

In order to create the fluent At you can create it in one of the following way:

  • at = Fluent("At", BoolType(), loc=Location)
  • at = Fluent("At", BoolType(), [Parameter('loc', Location)])
  • at = Fluent("At", BoolType(), OrderedDict([('loc', Location)]))

Let me know if this can solve your problem.

from unified-planning.

mikand avatar mikand commented on August 29, 2024 1

@alvalentini is right, however we should try to give a more meaningful error (if possible)

from unified-planning.

alexander-sung avatar alexander-sung commented on August 29, 2024

Nice. Thank you very much for the quick reply, @alvalentini. I assumed it was an interface change but looked at the wrong place. With your directions it is now clear that the type parameters of a fluent shall have names, which was missing in my old example. Bear with me, I surely still have a lot to catch up and thus very welcome Andrea's suggestion.

from unified-planning.

alexander-sung avatar alexander-sung commented on August 29, 2024

Nice. Thank you very much for the quick reply, @alvalentini. I assumed it was an interface change but looked at the wrong place. With your directions it is now clear that the type parameters of a fluent shall have names, which was missing in my old example. Bear with me, I surely still have a lot to catch up and thus very welcome Andrea's suggestion.

from unified-planning.

alexander-sung avatar alexander-sung commented on August 29, 2024

Sorry, I have a follow-up on this: Is it important that the user is providing specific parameter names? I'm just updating my examples and at some point create generic names, e.g., OrderedDict([(f"parameter{index}", Location) for index in range(3)]). So, I wondered if this is something you wanted to avoid.

I guess it depends on whether the user wants to use these parameter names at some point and might wonder what they are.

from unified-planning.

alvalentini avatar alvalentini commented on August 29, 2024

The parameter names are useful for documentation reasons (similarly to PDDL): they can explain the semantic of the parameters.

They can make easier to understand the problem you are modeling, reading the python code you wrote.

from unified-planning.

alexander-sung avatar alexander-sung commented on August 29, 2024

Makes sense. In my simple examples, it's rather obvious from the UserType but documentation is good. Many thanks again for your support! I really appreciate it.

from unified-planning.

Related Issues (20)

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.