You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Steps :
onDesireSetChanged
:const std::unordered_map<uint64_t, std::unordered_set<uint64_t>>& desireDependenciesById
DesireSetObserver
class, create an empty implementation foronDesireSetChanged
.DesireSetObserver
class, add the following method:virtual void onDesireFulfilled(uint64_t desireId)
.DesireSet
class, add the following field:std::unordered_map<uint64_t, std::unordered_set<uint64_t>> m_desiredependenciesById;
.DesireSet
class, make the method removeDesire remove all the dependencies recursively.DesireSet
class, add overload methods of addDesire that take astd::unordered_set<uint64_t>
as the first parameter.DesireSet
class, add a private method that makes the desire fulfilled. The method removes the desire fromm_desiresById
, removes the desire id from all set indesireDependenciesById
and callonDesireFulfilled
of the observers.DesireSet
class, makeBaseStrategy
a friend class.BaseStrategy
class, make the DesireSet private.BaseStrategy
, add a method that makes the current desire fulfilled by calling the method of theDesireSet
. Make sure the desire id is valid.Solver
andGecodeSolver
classes, add the following parameter to thesolve
method:const std::unordered_map<uint64_t, std::unordered_set<uint64_t>>& desireDependenciesById
Solver
class, theselectMostIntenseEnabledDesireIndexes
must only index that does not have any dependencies. Rename the method accordingly.The text was updated successfully, but these errors were encountered: