#include <stdlib.h>
#include <float.h>
+#define UNSETVALUE -1
+
AutoTuner::AutoTuner(uint _budget) :
- budget(_budget) {
+ budget(_budget), result(UNSETVALUE) {
}
void AutoTuner::addProblem(CSolver *solver) {
CSolver *copy = problem->clone();
copy->setTuner(tuner);
model_print("**********************\n");
- int result = copy->solve();
+ int sat = copy->solve();
+ if(result == UNSETVALUE)
+ result = sat;
+ else if(result != sat){
+ model_print("&&&&&&&&&&&&&&&&&& Result has changed &&&&&&&&&&&&&\n");
+ copy->printConstraints();
+ }
//model_print("SAT %d\n", result);
long long elapsedTime = copy->getElapsedTime();
// long long encodeTime = copy->getEncodeTime();
Vector<CSolver *> solvers;
uint budget;
+ int result;
};
#endif
void TunableSetting::print() {
if (hasVar) {
- model_print("Type1 %" PRIu64 ", ", type1);
- model_print("Type2 %" PRIu64 ", ", type2);
+ model_print("VarType1 %" PRIu64 ", ", type1);
+ model_print("VarType2 %" PRIu64 ", ", type2);
}
- model_print("Param %u = %u\n", param, selectedValue);
+ model_print("Param %s = %u \t range=[%u,%u]\n", tunableParameterToString( (Tunables)param), selectedValue, lowValue, highValue);
}
unsigned int tunableSettingHash(TunableSetting *setting) {
int DefaultTuner::getVarTunable(VarType vartype1, VarType vartype2, TunableParam param, TunableDesc *descriptor) {
return descriptor->defaultValue;
}
+
+const char* tunableParameterToString(Tunables tunable){
+ switch(tunable){
+ case DECOMPOSEORDER:
+ return "DECOMPOSEORDER";
+ case MUSTREACHGLOBAL:
+ return "MUSTREACHGLOBAL";
+ case MUSTREACHLOCAL:
+ return "MUSTREACHLOCAL";
+ case MUSTREACHPRUNE:
+ return "MUSTREACHPRUNE";
+ case OPTIMIZEORDERSTRUCTURE:
+ return "OPTIMIZEORDERSTRUCTURE";
+ case ORDERINTEGERENCODING:
+ return "ORDERINTEGERENCODING";
+ case PREPROCESS:
+ return "PREPROCESS";
+ case NODEENCODING:
+ return "NODEENCODING";
+ case EDGEENCODING:
+ return "EDGEENCODING";
+ case MUSTEDGEPRUNE:
+ return "MUSTEDGEPRUNE";
+ default:
+ ASSERT(0);
+ }
+}
\ No newline at end of file
enum Tunables {DECOMPOSEORDER, MUSTREACHGLOBAL, MUSTREACHLOCAL, MUSTREACHPRUNE, OPTIMIZEORDERSTRUCTURE, ORDERINTEGERENCODING, PREPROCESS, NODEENCODING, EDGEENCODING, MUSTEDGEPRUNE};
typedef enum Tunables Tunables;
+
+const char* tunableParameterToString(Tunables tunable);
#endif