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

Merge iw_run and mv_iw_run back #96

Open
gfrances opened this issue Nov 21, 2017 · 1 comment
Open

Merge iw_run and mv_iw_run back #96

gfrances opened this issue Nov 21, 2017 · 1 comment

Comments

@gfrances
Copy link
Member

iw_run and mv_iw_run could probably be merged back to reduce a lot of code duplication.
See some good notes by @miquelramirez on this here: #91 (comment). I'm copying them verbatim below:

  • IWRunNode vs MultiValuedRunNode: The biggest differences between the two classes lie in code which was commented out and I deleted. Other than that, the real difference (and subtle) I see is that the attribute _nov_2_pairs needs to be defined differently in either class. For the former, is a table of pairs of AtomIdx, in the latter a pair of Width1Tuple a type which is imported from lapkt::novelty and defined around the language type we represent our datums (FSFeatureValueT)..

  • SimulationEvaluator vs MultiValuedSimulationEvaluator: the major difference between the two classes is in the implementation of the method reached_atoms(). In both classes it is defined as const, but it has different return types: std::vector<bool> vs. std::vector<Width1Tuple>. This is important: the former assumes datums are booleans, the latter assumes datums to be FSFeatureValueT. Also a convenience accessor to the set of features associated with the evaluator has been added to the interface of MultiValuedSimulationEvaluator.

  • IWRun::Config vs MultiValuedIWRun::Config: the attribute mark_negative has been removed from the latter as it doesn't make sense in the context of the second class. Three new attributes have been added to the latter, _R_file and _log_search activate the code that allows to load the R set from a file, and the code that logs the IW search tree into a JSON document. _filter_R_set is no longer used: I did some experimentation with doing some "post processing" on the R-set, without much success.

  • MultiValuedIWRun::DeactivateZCC class added to track option to ignore state constraints during the IW(k) lookahead. The term "zero crossings" refers to allowing IW to shoot through the "holes" in the state space created by state constraints.

  • IWRun vs MultiValuedIWRun: quite a few changes

    • The attribute _visited has been added to MultiValuedIWRun to store the set of states visited during the lookahead.
    • MultiValuedIWRun::mark_tuples_in_path_to_subgoal(): Important changes here, as first, datums are no longer boolean, and rather than accessing state variables directly, we use the feature set in the evaluator.
  • MultiValuedIWRun::mark_all_tuples_in_path_to_subgoal: Analogous changes to the above.

  • MultiValuedIWRun::compute_R_all(): Method has been disabled with an exception.

  • MultiValuedIWRun::compute_R(): Added code to load R-set from file.

  • MultiValuedIWRun::compute_plain_RG2(): Added check for goal_directed flag, if false, extract_R_1 is called.

  • MultiValuedIWRun::compute_plain_R1(): Changed return type to match that of the datums.

  • MultiValuedIWRun::load_R_set(): Loads the R set from a file.

  • MultiValuedIWRun::filter_R_set(): Experiments with R-set filtering, no longer used.

  • MultiValuedIWRun::compute_coupled_features(): Added toIWRun because of static polymorphism. Method used in experiments filtering R-set, no longer used.

  • MultiValuedIWRun::dump_R_set(): Code to dump the R-set to a file.

  • MultiValuedIWRun::extract_R_1(): Changed return type to match that of datum.

  • MultiValuedIWRun::compute_R_g_prime(): $R_{all}$ fallback disabled.

  • MultiValuedIWRun::compute_adaptive_R(): Changed return type to match that of datum.

  • MultiValuedIWRun::extract_R_G(): Added code to dump R set to file, changed return type to match that of the datum.

  • MultiValuedIWRun::extract_R_G_1(): Idem as MultiValuedIWRun::extract_R_G().

  • ```MultiValuedIWRun::run()``: added code to check if IW(k) lookahead needs to respect state constraints, uses this info to influence the behaviour of the applicable action iterators.

  • ```MultiValuedIWRun::report()``: added code to store the search tree that follows from IW(k) into a file.

Summary

The filtering of R sets and its associated methods need to be moved out of the class. I would like to have them somewhere, as a snippet of some sort and a note, since the idea of post-processing R-sets may have some potential.

The rest of the changes are related to switching the underlying datum used to compute w(s) from bool to FSFeatureValueT (which is unsigned), and that we need to use the features to obtain the relevant valuations.

@miquelramirez
Copy link
Member

I hope this helped @gfrances !

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

No branches or pull requests

2 participants