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

Desire dependencies are not implemented #19

Open
13 tasks
mamaheux opened this issue Feb 19, 2024 · 0 comments
Open
13 tasks

Desire dependencies are not implemented #19

mamaheux opened this issue Feb 19, 2024 · 0 comments

Comments

@mamaheux
Copy link
Collaborator

Steps :

  • Remove the following difference in the README.md file: Desires cannot have dependencies;
  • In the DesireSetObserver class, add the following parameter to onDesireSetChanged : const std::unordered_map<uint64_t, std::unordered_set<uint64_t>>& desireDependenciesById
  • In the DesireSetObserver class, create an empty implementation for onDesireSetChanged.
  • In the DesireSetObserver class, add the following method: virtual void onDesireFulfilled(uint64_t desireId).
  • In the DesireSet class, add the following field: std::unordered_map<uint64_t, std::unordered_set<uint64_t>> m_desiredependenciesById;.
  • In the DesireSet class, make the method removeDesire remove all the dependencies recursively.
  • In the DesireSet class, add overload methods of addDesire that take a std::unordered_set<uint64_t> as the first parameter.
  • In the DesireSet class, add a private method that makes the desire fulfilled. The method removes the desire from m_desiresById, removes the desire id from all set in desireDependenciesById and call onDesireFulfilled of the observers.
  • In the DesireSet class, make BaseStrategy a friend class.
  • In the BaseStrategy class, make the DesireSet private.
  • In the BaseStrategy, add a method that makes the current desire fulfilled by calling the method of the DesireSet. Make sure the desire id is valid.
  • In the Solver and GecodeSolver classes, add the following parameter to the solve method: const std::unordered_map<uint64_t, std::unordered_set<uint64_t>>& desireDependenciesById
  • In the Solver class, the selectMostIntenseEnabledDesireIndexes must only index that does not have any dependencies. Rename the method accordingly.
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

1 participant