Commit a680b43c authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

using weight in SampleSolution

parent c5fd45be
...@@ -33,18 +33,19 @@ protected: ...@@ -33,18 +33,19 @@ protected:
virtual void plotSolution(SampleSolution &solution) = 0; virtual void plotSolution(SampleSolution &solution) = 0;
void weightSolution(SampleSolution &solution) const { void weightSolution(SampleSolution &solution) const {
solution.Q = GetProblem()->SampleWeight(solution.id) * solution.Q; solution.W = GetProblem()->SampleWeight(solution.id);
} }
public: public:
PDESolver(const Meshes &meshes, const std::string &quantity, PDESolver(const Meshes &meshes,
const std::string &quantity,
const std::string &costMeasure) : const std::string &costMeasure) :
meshes(meshes), quantity(quantity), costMeasure(costMeasure) { meshes(meshes), quantity(quantity), costMeasure(costMeasure) {
config.get("PDESolverVerbose", verbose); config.get("PDESolverVerbose", verbose);
config.get("PDESolverPlotting", plotting); config.get("PDESolverPlotting", plotting);
} }
virtual ~PDESolver() {}; virtual ~PDESolver() = default;
virtual void PrintInfo() const { virtual void PrintInfo() const {
if (verbose > 0) if (verbose > 0)
...@@ -61,7 +62,6 @@ public: ...@@ -61,7 +62,6 @@ public:
computeCost(solution); computeCost(solution);
plotSolution(solution); plotSolution(solution);
weightSolution(solution); weightSolution(solution);
// Todo other idea: Add weight as class member of solution
vout(2) << "Q=" << solution.Q << " cost=" << solution.C << endl; vout(2) << "Q=" << solution.Q << " cost=" << solution.C << endl;
mout.EndBlock(verbose <= 1); mout.EndBlock(verbose <= 1);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment