Issue501

Title (some) anytime configurations write plan to wrong files
Priority critical Status resolved
Superseder Nosy List florian, jendrik, malte
Assigned To florian Keywords
Optional summary

Created on 2014-12-13.15:53:53 by malte, last changed by florian.

Messages
msg3966 (view) Author: florian Date: 2014-12-18.11:09:31
Ok, done and merged. Sorry for all the branch re-opening. I'm closing the issue
again.
msg3965 (view) Author: malte Date: 2014-12-17.23:44:22
I don't think that name needs to be changed, but of course the parameter should
only be passed in when using an anytime (= satisficing) portfolio. An portfolio
for optimal planning can never have a previous plan and hence doesn't use this
option -- that sounds fine enough for me.
msg3961 (view) Author: florian Date: 2014-12-17.18:35:02
How about the option "--internal-previous-portfolio-plans"? Should I rename it too?
msg3959 (view) Author: jendrik Date: 2014-12-17.15:22:24
I suggested more or less the same solution.
msg3958 (view) Author: malte Date: 2014-12-17.14:11:30
Ah, right, of course the name isn't so well suited in that case. For optimal
portfolios, only one plan is generated, so the search component doesn't need to
do anything special. Perhaps rename to "g_is_part_of_anytime_portfolio"?
msg3957 (view) Author: jendrik Date: 2014-12-17.13:36:53
Florian and I noted one thing today: the --internal-previous-portfolio-plans is 
only passed for satisficing portfolios and therefore g_is_part_of_portfolio is 
false for optimal portfolios. How would you like us to handle this, Malte?
msg3955 (view) Author: florian Date: 2014-12-17.12:03:29
Merged. I renamed the variable g_previously_generated_plans to
g_num_previously_generated_plans as Jendrik suggested.
msg3952 (view) Author: jendrik Date: 2014-12-16.15:19:07
I agree that it can be merged.
msg3944 (view) Author: malte Date: 2014-12-15.17:36:01
Thanks! I also had a brief look and it looks good to me, so if it works and if
Jendrik is also happy with the code, I think it's ready to merge.
msg3943 (view) Author: florian Date: 2014-12-15.16:07:59
I uploaded the changes to
  https://bitbucket.org/flogo/downward-issues-issue501/pull-request/1

Jendrik volunteered to do a review.
msg3942 (view) Author: malte Date: 2014-12-15.13:56:41
> How should we test for this?

I suggest that the callers to save_plan pass this information as a boolean argument.
msg3941 (view) Author: florian Date: 2014-12-15.13:33:40
Fine with me.

> [...] or if we are conducting an iterated search.

How should we test for this?
msg3940 (view) Author: malte Date: 2014-12-15.13:20:42
> Does this concern any configuration besides LAMA or iterated search?

LAMA is a special case of iterated search. I assume it only concerns iterated
search. (Note that there's nothing special about LAMA -- it's a bog-standard
command-line alias for an iterated search configuration, no special handling in
the driver.)

> We could either pass "--internal-plan-counter 1" to the configurations in
> question,

That is not a solution. "--internal-plan-counter" is an internal (i.e., not
intended to be user-visible) option for use of the driver only, like all options
starting with "--internal". It's intended to be used only for communication of
the driver with the search component (mainly for portfolios).


Setting g_plan_counter to different values that must be interpreted differently
depending on the kind of search looks fragile to me. I think the semantics of
the variable wouldn't be very clear. (What would the intuitive meaning of a plan
counter of 0 vs. 1 be?) I'm also not sure if the suggested solution would
interact correctly if we combine portfolios and anytime configurations.

I think a better solution is to have it always reflect the number of previously
generated plans and rename it (along with the option) to make this clear:
"g_num_previously_generated_plans" and "--internal-previously-generated-plans"
or something shorter along those lines. The planner knows if it wants to
potentially generate multiple plans (whenever iterated search is used), so it
knows how to distinguish "sas_plan" from "sas_plan.1" in that case
automatically. For portfolio configurations, we must make sure that the planner
prefers "sas_plan.1" over "sas_plan" even for non-iterated configurations. One
way to do this is to have "--internal-previously-generated-plans" additionally
set a flag that shows we are in a portfolio. To make this clearer, the option
could be renamed to "--internal-previous-portfolio-plans".

Summary of suggestion:

- g_previously_generated_plans defaults to 0
- g_is_part_of_portfolio defaults to false
- Option "--internal-previous-portfolio-plans X" sets
g_previously_generated_plans to X and g_is_part_of_portfolio to true
- When a plan is generated, we increment "g_previously_generated_plans" and
append the counter to the plan name if we are in a portfolio or if we are
conducting an iterated search. We add an assertion that in other cases, the
counter must necessarily be 0 (or 1 if we test it after incrementing)

What do you think?
msg3937 (view) Author: jendrik Date: 2014-12-15.12:37:09
I agree with Florian. We should probably set g_plan_counter to 1 for iterated 
searches.
msg3935 (view) Author: florian Date: 2014-12-15.11:34:56
I'm not sure how this was handled before. Currently, there is a counter
(g_plan_counter) that is initialized to 0 but that can be overwritten with the
command line argument "--internal-plan-counter". Whenever a plan is stored, the
counter is appended to the filename (except when it is 0) and then incremented.

We could either pass "--internal-plan-counter 1" to the configurations in
question, or we could change the code of iterated search to set g_plan_counter
to at least 1. The latter has the advantage that users can still use other
values for "--internal-plan-counter".

Does this concern any configuration besides LAMA or iterated search?
msg3925 (view) Author: malte Date: 2014-12-13.15:53:52
$ ./fast-downward.py --alias seq-sat-lama-2011
../benchmarks/blocks/probBLOCKS-8-0.pddl

finds four plans, which are written to files sas_plan, sas_plan.1, sas_plan.2
and sas_plan.3.

They should have been written to sas_plan.{1,2,3,4}: according to IPC rules, the
planner should *either* use sas_plan *or* sas_plan.XXX, not both. Presumably
something went wrong when we changed the interaction between the driver script
and iterated search/portfolios.
History
Date User Action Args
2014-12-18 11:09:31floriansetstatus: chatting -> resolved
messages: + msg3966
2014-12-17 23:44:22maltesetmessages: + msg3965
2014-12-17 18:35:02floriansetmessages: + msg3961
2014-12-17 15:22:24jendriksetmessages: + msg3959
2014-12-17 14:11:30maltesetmessages: + msg3958
2014-12-17 13:36:53jendriksetstatus: resolved -> chatting
messages: + msg3957
2014-12-17 12:03:29floriansetstatus: reviewing -> resolved
messages: + msg3955
2014-12-16 15:19:07jendriksetmessages: + msg3952
2014-12-15 17:36:01maltesetmessages: + msg3944
2014-12-15 16:07:59floriansetstatus: chatting -> reviewing
messages: + msg3943
2014-12-15 13:56:41maltesetmessages: + msg3942
2014-12-15 13:33:40floriansetmessages: + msg3941
2014-12-15 13:20:42maltesetmessages: + msg3940
2014-12-15 12:37:09jendriksetmessages: + msg3937
2014-12-15 12:19:15jendriksetnosy: + jendrik
2014-12-15 11:34:56floriansetnosy: + florian
messages: + msg3935
assignedto: florian
2014-12-13 15:53:53maltecreate