Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multi-valued state variables, boolean expressions, global constraints, etc. #64

Open
5 of 6 tasks
madmage opened this issue Nov 2, 2021 · 5 comments
Open
5 of 6 tasks

Comments

@madmage
Copy link
Member

madmage commented Nov 2, 2021

User Story

As a TSB Developer I want the UPF to support the description that we internally use in our company. In our system, the planner is responsible on deciding what action to start/abort in the current state. The description of the problem is encoded by the developers in a proprietary YAML-based file, called YADDL (pron. ['ja:dl]), this description is then translated into a more planning-friendly description. While the system is running, the current state is computed and the planner outputs the current operations to be performed to reach a specified goal. In our system the state can change unpredictably, i.e. the state can change for reasons external to the actions being performed (exogenous events).

In particular, our problem description has the following features (that I am not sure if they are already implemented in the UPF):

  • our state is described by a set of multi-valued (enum) variables (something like SAS+), both in YADDL and in the planning-friendly translation
  • actions are not instantaneous, we are currently not considering their duration, but only that some action has a start and an end, this is encoded in YADDL by flagging them as non-durative, but they are then split in the planning-friendly translation into a predefined set of instantaneous actions: start, finish, abort and aborted; it is important to notice that while the executor can start or abort a durative action, it can only wait for it to finish or become aborted (that is: it is an expected event, that "eventually" will happen)
  • the effects of the actions are not deterministic, at least they can either succeed or fail, and the effects are different in the two cases, but we also have sometimes non-determinism in the success or the failure of an action; we are already considering to extend this non-determinism to include probabilities (this is true both in the YADDL version and in the planning-friendly translation, in the latter we just have a list of possible variable assignments)
  • we have the notion of global constraints, that is a set of boolean expressions that must always hold if their conditions are met; the planner should never produce a plan that violates these constraints, but it can happen that, because of the exogenous events, the current state violates the constraints (both in YADDL and in the planning-friendly translation)
  • our current goal is described as a set of boolean expressions over the state variables, each expression has an optional condition (that enables it) and a priority (the planner should consider lower priority goals if the higher priority goals are all met) (this is the same both in the YADDL description and in the planning-friendly description)
  • we can specify a cost for the actions: we currently use this only to instruct the planner that it is always preferable to abort an action than to wait for it to finish, if in the current state we are not interested in the outcomes of successfully finishing that action (this is optional for the YADDL description and we are currently not using it, but during the translation into the planning-friendly description, the start, finish, abort and aborted actions are given the suitable cost)

We would like to use the UPF to encode at least the planning-friendly translation, for this reason we need the features summarized in the Acceptance Criteria below.

Acceptance Criteria

The UPF description should:

  • allow to specify multi-valued state variables
  • allow to specify non-deterministic effects (i.e. the effect of an action can be one-of a set of effects), and possibly probabilities
  • allow to specify action costs
  • allow to specify the action (pre-)conditions in terms of boolean expressions over the state variables
  • allow to specify global constraints in the form of boolean expressions over the state variables
  • allow to specify the goals as a set of boolean expressions with a condition and a priority

Additional material

Here is an example of a YADDL file, in its current version.

wait-next-job.yaddl.yaml.txt

@madmage madmage changed the title Support for Support for multi-valued state variables, boolean expressions, global constraints, etc. Nov 2, 2021
@madmage
Copy link
Member Author

madmage commented Feb 2, 2022

I updated the "Acceptance Criteria", as I am trying to use the unified_planning to define our problem and I see that

  • we can already specify multi-valued state variables (I associated an object to each possible value of the state variables and I specified UserTypes for each of them).
  • we can already specify actions (pre-)conditions in terms of boolean expressions over the state variables

@madmage
Copy link
Member Author

madmage commented Mar 3, 2022

I updated again the "Acceptance Criteria", I saw that we can specify action costs with set_cost(), although I am not sure how this is addressed by the planners (should they be set to minimize/maximize the cost?) and although I see a PR that is going to change how the cost is addressed #91

@alvalentini
Copy link
Member

In #91 we move the costs inside the MinimizeActionsCost class, that represents one of the possible plan quality metrics.
I think that in this way it is clearer how the planners have to consider the costs.

@madmage
Copy link
Member Author

madmage commented Mar 4, 2022

@alvalentini from my perspective, I see the action cost as related to the action (action1.cost = fluent1+1 and the problem says to minimize the cost) rather than to a quality measure of the problem (action1 has no cost and the problem has a quality measure where the action1 has cost fluent+1), I guess there has been a reason to do this, but I didn't follow any discussion about it so I may be missing important context.

@mikand
Copy link
Member

mikand commented Aug 10, 2023

@madmage Does it make sense to close this or do you want to keep this open as a reminder that we shall support nondeterministic effects? ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants