Projet du cours MPRI 2.24.2 "Résolution de problèmes d'optimisation avec heuristiques de recherche" : https://wikimpri.dptinfo.ens-cachan.fr/doku.php?id=cours:c-2-24-2
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SearchHeuristic.h 837B

  1. #ifndef SEARCHHEURISTIC_H
  2. #define SEARCHHEURISTIC_H
  3. #include "MasterMind.h"
  4. struct Candidate {
  5. Candidate(int* s, int v) {
  6. sol = s;
  7. value = v;
  8. }
  9. int* sol;
  10. int value;
  11. };
  12. struct {
  13. bool operator()(Candidate* a, Candidate* b) const {
  14. return a->value > b->value;
  15. }
  16. } cmp_candidates;
  17. struct Result {
  18. Result(int* s, int v, int c) {
  19. solution = s;
  20. v_solution = v;
  21. nb_calls = c;
  22. }
  23. int* solution;
  24. int v_solution;
  25. int nb_calls;
  26. };
  27. class SearchHeuristic
  28. {
  29. public:
  30. SearchHeuristic();
  31. virtual Result run() = 0;
  32. void set_problem(MasterMind* problem);
  33. virtual ~SearchHeuristic();
  34. protected:
  35. MasterMind* m_problem;
  36. private:
  37. };
  38. #endif // SEARCHHEURISTIC_H