#include "autotuner.h"
#include "csolver.h"
-void AutoTuner::tune(CSolver *base) {
+void AutoTuner::addProblem(CSolver *solver) {
+ solvers.push(solver);
+}
+
+void AutoTuner::tune() {
}
#ifndef AUTOTUNER_H
#define AUTOTUNER_H
#include "classlist.h"
+#include "structs.h"
class AutoTuner {
public:
AutoTuner();
- void tune(CSolver *solver);
+ void addProblem(CSolver *solver);
+ void tune();
MEMALLOC;
private:
+ Vector<CSolver *> solvers;
};
#endif
--- /dev/null
+#include "searchtuner.h"
+
+SearchTuner::SearchTuner() {
+}
+
+int SearchTuner::getTunable(TunableParam param, TunableDesc *descriptor) {
+ return 0;
+}
+
+int SearchTuner::getVarTunable(VarType vartype, TunableParam param, TunableDesc *descriptor) {
+ return 0;
+}
+
+TunableParameter::TunableParameter(VarType _type, TunableParam _param) :
+ hasVar(true),
+ type(_type),
+ param(_param) {
+}
+
+TunableParameter::TunableParameter(TunableParam _param) :
+ hasVar(false),
+ type(0),
+ param(_param) {
+}
+
+TunableDecision::TunableDecision(int _low, int _high, int _default, int _selection) :
+ lowValue(_low),
+ highValue(_high),
+ defaultValue(_default),
+ selectedValue(_selection) {
+}
--- /dev/null
+#ifndef SEARCHTUNER_H
+#define SEARCHTUNER_H
+#include "classlist.h"
+#include "tunable.h"
+
+class SearchTuner : public Tuner {
+ public:
+ SearchTuner();
+ int getTunable(TunableParam param, TunableDesc *descriptor);
+ int getVarTunable(VarType vartype, TunableParam param, TunableDesc *descriptor);
+ MEMALLOC;
+ private:
+};
+
+class TunableParameter {
+ public:
+ TunableParameter(VarType type, TunableParam param);
+ TunableParameter(TunableParam param);
+ MEMALLOC;
+ private:
+ bool hasVar;
+ VarType type;
+ TunableParam param;
+};
+
+class TunableDecision {
+ public:
+ TunableDecision(int _low, int _high, int _default, int _selection);
+ MEMALLOC;
+ private:
+ int lowValue;
+ int highValue;
+ int defaultValue;
+ int selectedValue;
+};
+
+#endif
void CSolver::autoTune() {
AutoTuner * autotuner=new AutoTuner();
- autotuner->tune(this);
+ autotuner->addProblem(this);
+ autotuner->tune();
}