Skip to content

Desire dependencies are not implemented #19

@mamaheux

Description

@mamaheux

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions