#include #include "CostModel.h" using std::fstream; using std::ios; ostream& operator<<(ostream& out, const CostModel& cost) { for (int i = 1; i < none; ++i) { out << cost.weights[i] << "\t"; } out << endl; return out; } void CostModel::setWeights() { fstream input; input.open("costmodel.dat", ios::in); if ( !input ) { throw string("FILE NOT FOUND"); } string line; input >> line; int index = 0; while ( !input.eof() ) { weights[index++] = atoi(line.c_str()); getline(input, line); input >> line; } }