#define UNSETVALUE -1
-Problem::Problem(const char *_problem) : result(UNSETVALUE) {
+Problem::Problem(const char *_problem) : problemnumber(-1), result(UNSETVALUE) {
uint len = strlen(_problem);
problem = (char *) ourmalloc(len + 1);
memcpy(problem, _problem, len + 1);
}
void MultiTuner::addProblem(const char *filename) {
- problems.push(new Problem(filename));
+ Problem *p = new Problem(filename);
+ p->problemnumber = problems.getSize();
+ problems.push(p);
}
void MultiTuner::printData() {
allTuners.push(t);
}
+
+void MultiTuner::readData(uint numRuns) {
+ for (uint i = 0; i < numRuns; i++) {
+ ifstream myfile;
+ char buffer[512];
+ uint tunernum;
+ snprintf(buffer, sizeof(buffer), "tunernum%u", i);
+ myfile.open (buffer, ios::in);
+ myfile >> tunernum;
+ myfile.close();
+
+ char problemname[512];
+ snprintf(buffer, sizeof(buffer), "problem%u", i);
+ myfile.open(buffer, ios::in);
+ myfile.getline(problemname, sizeof(problemname));
+ myfile.close();
+
+
+
+
+ }
+
+}
+
long long MultiTuner::evaluate(Problem *problem, TunerRecord *tuner) {
char buffer[512];
{
if (myfile.is_open()) {
myfile << problem->getProblem() << endl;
+ myfile << problem->problemnumber << endl;
myfile.close();
}
}