BinaryHeuristic.h 546 B

123456789101112131415161718192021
  1. #pragma once
  2. #include "ObjectiveFunction.h"
  3. #include <functional>
  4. #include <ostream>
  5. #include "Random.h"
  6. class BinaryHeuristic
  7. {
  8. public:
  9. BinaryHeuristic(std::ostream& outstream);
  10. enum class ObjectiveFunctionGoal { min, max };
  11. virtual Solution execute(int rounds, int n, std::function<double(const std::vector<bool>&)> objectiveFunction, ObjectiveFunctionGoal goal) = 0;
  12. protected:
  13. //Interfaces
  14. PseudoRandom rand;
  15. std::ostream& outstream;
  16. std::function<bool(double, double)> getOperatorFromGoal(ObjectiveFunctionGoal goal);
  17. private:
  18. };