void MultiTuner::addTuner(SearchTuner *tuner) {
TunerRecord *t = new TunerRecord(tuner);
tuners.push(t);
+ t->tunernumber = allTuners.getSize();
allTuners.push(t);
}
}
}
+ {
+ snprintf(buffer, sizeof(buffer), "tunernum%u", execnum);
+
+ ofstream myfile;
+ myfile.open (buffer, ios::out);
+
+
+ if (myfile.is_open()) {
+ myfile << tuner->tunernumber << endl;
+ myfile.close();
+ }
+ }
+
//Write out the tuner
snprintf(buffer, sizeof(buffer), "tuner%u", execnum);
tuner->getTuner()->serialize(buffer);
for (uint i = 0; i < tSize; i++) {
SearchTuner *tmpTuner = mutateTuner(tunerV->get(i)->getTuner(), b);
TunerRecord *tmp = new TunerRecord(tmpTuner);
+ tmp->tunernumber = allTuners.getSize();
allTuners.push(tmp);
tunerV->push(tmp);
}
for (uint i = 0; i < budget; i++) {
SearchTuner *tmpTuner = mutateTuner(oldTuner->getTuner(), i);
TunerRecord *newTuner = oldTuner->changeTuner(tmpTuner);
+ newTuner->tunernumber = allTuners.getSize();
allTuners.push(newTuner);
double newScore = evaluateAll(newTuner);
newTuner->tuner->printUsed();
class TunerRecord {
public:
- TunerRecord(SearchTuner *_tuner) : tuner(_tuner) {}
+ TunerRecord(SearchTuner *_tuner) : tuner(_tuner), tunernumber(-1) {}
SearchTuner *getTuner() {return tuner;}
TunerRecord *changeTuner(SearchTuner *_newtuner);
void updateTuner(SearchTuner *_newtuner) {tuner = _newtuner;}
SearchTuner *tuner;
Vector<Problem *> problems;
Hashtable<Problem *, long long, uint64_t> timetaken;
+ int tunernumber;
friend class MultiTuner;
friend void clearVector(Vector<TunerRecord *> *tunerV);
};