Commit 0eaf0c49 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

using UpdateSampleCounter

parent ffff9da7
......@@ -13,7 +13,7 @@ void MonteCarloMap::UpdateSampleCounter(double epsilon) {
optimalM = (int) (ceil(2 * pow(epsilon, -2) * factor *
sqrt(mc.vars.Y / mc.avgs.Cost)));
if (optimalM == 1) optimalM++; // Hack
mc.ctr.dM = optimalM - mc.ctr.M;
mc.ctr.UpdateSampleCounter(optimalM - mc.ctr.M);
}
}
......
#include "SampleCounter.hpp"
void SampleCounter::Update() {
M += PPM->SumOnCommSplit(dMComm, 0);
// M += PPM->SumOnCommSplit(dMComm, 0);
M += dM;
dMComm = 0;
dM = 0;
}
\ No newline at end of file
......@@ -13,7 +13,12 @@ struct SampleCounter {
SampleCounter() {};
SampleCounter(int dM) : dM(dM) {
SampleCounter(int dM) {
UpdateSampleCounter(dM);
}
void UpdateSampleCounter(int dM) {
this->dM = dM;
if (distSamples) {
for (int i = 0; i < ceil(log2(PPM->Size(0))) + 1; i++) {
if (dM >= PPM->Size(i)) {
......
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