Minotaur 0.4.1
Docs for developers
SamplingHeur.h
Go to the documentation of this file.
1//
2// Minotaur -- It's only 1/2 bull
3//
4// (C)opyright 2008 - 2025 The Minotaur Team.
5//
6
15#ifndef MINOTAURSAMPLINGHEUR_H
16#define MINOTAURSAMPLINGHEUR_H
17
18#include "Heuristic.h"
19#include "Types.h"
20
21namespace Minotaur
22{
23class Problem;
28 UInt numSol; // Number of solutions found
29 double time; // Time taken in this heuristic
30 UInt checked; // Number of points checked
31};
32
33class SamplingHeur : public Heuristic
34{
35public:
38
41
44
46 void writeStats(std::ostream& out) const;
47
48private:
49 // Environment
50 EnvPtr env_;
51
52 // Maximum random solutions to check
53 UInt maxRand_;
54
55 // For printing messages
56 static const std::string me_;
57
58 // Problem
59 ProblemPtr p_;
60
61 // Statistics
62 SamplingHeurStats* stats_;
63
64 // get new point from a feasible point
65 void getNewPoint_(double* x, double* xl, double* xu, SolutionPoolPtr s_pool);
66
67 // Check whether x is feasible
68 bool isFeasible_(const double* x);
69};
70
72} // namespace Minotaur
73#endif
74
Define abstract base class for heuristics of various kinds.
Declare important 'types' used in Minotaur.
Definition: Environment.h:28
Definition: Heuristic.h:30
Definition: Node.h:54
Definition: Problem.h:74
Definition: Relaxation.h:53
Definition: SamplingHeur.h:34
SamplingHeur(EnvPtr env, ProblemPtr p)
default constructor
Definition: SamplingHeur.cpp:33
void writeStats(std::ostream &out) const
writing the statistics to the logger
Definition: SamplingHeur.cpp:289
void solve(NodePtr, RelaxationPtr, SolutionPoolPtr s_pool)
call to heuristic
Definition: SamplingHeur.cpp:49
~SamplingHeur()
default destructor
Definition: SamplingHeur.cpp:44
Definition: SolutionPool.h:28
Definition: ActiveNodeStore.h:20
unsigned int UInt
Unsigned integer.
Definition: Types.h:30
A statistic struct for trivial heuristic.
Definition: SamplingHeur.h:27

Minotaur source code documented by Doxygen 1.9.4 on Thu Apr 24 2025