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

byte-tree-map for distance explorer #180

Open
wants to merge 44 commits into
base: distance-explorer-base
Choose a base branch
from

Conversation

Necktschnagge
Copy link
Owner

@Necktschnagge Necktschnagge commented Aug 5, 2024

Byte tree map for distance explorer

Dependencies:

Summary

  • Introduces a new data structure, byte_tree_map, for using in distance exploration instead of sorted level vectors

Changes

New Features

  • class byte_tree_map

Fixes

TODOs

  • consider adding distance explorer as a template argument to solver_environment to choose which distance explorer to use.
  • prettiness_evaluator.h We typedef many sub types there. Maybe some of them could be template arguments to make features more flexible. Check this.

Follow-up Actions

  • Counting raw solutions per equivalence class #190
  • class prettiness_evaluator uses graph structure that can be optimized. It uses key values for referencing successors and requires seraching for key values in iterating contexts. affects the graph itsel afaik and the annotations
  • class prettiness_evaluator has some feature requests at its end: See TODOs in code.

Knowledge:

further ideas

  • use some strategy pattern to let the user choose which algorithm / data structure to use
    • We need a solver environment interface and two concrete implementations.
    • edit: it might be a better solution to use templates

@Necktschnagge Necktschnagge mentioned this pull request Aug 7, 2024
19 tasks
@ci-for-necktschnagge
Copy link
Collaborator

See dependency diagram here: 1f335ce94552bed79e277307fdd72c9eb04f9b04.pdf

@ci-for-necktschnagge
Copy link
Collaborator

See dependency diagram here: c85f4cb6fe0558ca1f2e41a00e6ee1e87712a758.pdf

@ci-for-necktschnagge
Copy link
Collaborator

See dependency diagram here: 43448c6ee04430fa02bd94377b6b8ee2aca7a72e.pdf

@ci-for-necktschnagge
Copy link
Collaborator

See dependency diagram here: 5f7bc4975642a458d7ab3407d8c8feeecf39973c.pdf


private:

using target_distance_map_type = std::map<cell_id_type, size_type>;
//using target_distance_map_type = std::map<cell_id_type, size_type>;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be an option to use std::map for performance comparison

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review hint is correct but does not match the line.

We should offer std::map instead of byte_tree_map.

* If entirely explored, and the farest found state is at depth x, then must contain an entry (x+1, {empty vector}).
* It means depth x has been explored, leafs of x+1 are empty.
*/
unexplored_map _unexplored_by_depth; // use this to replace _unexplored_leafs and also _max_exploration_depth #### note that the other variant might be better as long as we do not use true A* algorithm here.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decide for a final decision here using map or single vector + depth variable

@ci-for-necktschnagge
Copy link
Collaborator

See dependency diagram here: d72528189bf3a42c80a9e8c332e45a3770b92581.pdf


size_type _state_count_threshold{ 0 };
size_type _max_depth{ 0 };
using distance_int = uint8_t;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check usage and size_t conversions!

* @details Explores the state space according to \p policy
* @details Clears \p destination first anyway.
Explores the state space according to \p policy.
Leaves \p destination empty and returns immediately if exploration did not find \p target_cell.
*/
template<class State_Label_T>
void get_simple_bigraph(
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review this function again / for the first time!

@ci-for-necktschnagge
Copy link
Collaborator

See dependency diagram here: 426c8039e056810ce145d74a99c659cc0324eb08.pdf

@ci-for-necktschnagge
Copy link
Collaborator

See dependency diagram here: 1b10bf138cf7a03830d8143899189990bc264a03.pdf

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

Successfully merging this pull request may close these issues.

3 participants