Hi,
The easy way to do what you want is using quantified preconditions.
From your example, I'm guessing (studyLearningMaterial ?sc ?st ?sl)
means something like "the student has completed content ?sc on topic ?st
to level ?sl".
Adding the condition
(forall (?prec - studylm ?pret - studyTopic ?prel - studyLevel)
(imply (is-prereq ?prec ?pret ?prel ?sc ?st ?sl)
(studyLearningMaterial ?prec ?pret ?prel)))
to the precondition of your study action enforces that
(studyLearningMaterial ?prec ?pret ?prel) must already be true for every
content/topic/level that has been specified a prereq. For example, if
you wanted (studyLearningMaterial slm1 algorithms bloom4) to require
(studyLearningMaterial somelm java bloom4) as a prereq, then you would
add (is-prereq somelm java bloom4 slm1 algorithms bloom4) to the initial
state. (The predicate is-prereq is static, meaning it is not changed by
any action.)
The idea is probably easier to follow if you look at a simpler example:
Suppose you have partially set of tasks (for example T1, .., T5) and a
partial order of precedence constraints (for example T1 < T4, T2 < T3,
T3 < T4 and T3 < T5). Use a predicate (done ?task) to represent if a
task has been done, and (precedes ?prec ?task) to represent the
precedence order. The action that does a task can be written
(:action do
:parameters (?task)
:precondition (forall (?tprime) (imply (precedes ?tprime ?task) (done
?tprime)))
:effect (done ?task)
)
The initial state would include (precedes T1 T4), (precedes T2 T3),
(precedes T3 T4), and (precedes T3 T5), and the goal is (and (done T1)
(done T2) (done T3) (done T4) (done T5)). Note how actions (do T1) and
(do T2) have effectively no precondition, since those tasks have no
precedences.
If you want to avoid quantified preconditions (they're not supported by
a lot of planners, though I think FD should be fine with them), you need
to have a different action for each number of prereqs (so one action for
subjects with no prereqs, one for subjects with one prereq, and so on),
so that you can make the parameters of the prereq subject (?prec, ?pret,
?prel above) parameters of the action.
Hope that is of some help,
/P@trik
> --
> You received this message because you are subscribed to the Google
> Groups "Fast Downward" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
fast-downwar...@googlegroups.com
> <mailto:
fast-downwar...@googlegroups.com>.
> For more options, visit
https://groups.google.com/d/optout.