Commit 684e62a3 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

adapted new logger functions

parent 451dbb44
......@@ -38,15 +38,15 @@ void MultilevelMonteCarlo::clearMapMonteCarlo() {
}
void MultilevelMonteCarlo::Method() {
logger->startMethodMSG();
logger->StartMethodMsg();
for (auto &mc : mapMonteCarlo)
mc.second->Method();
logger->endMethodMSG();
logger->EndMethodMsg();
}
void MultilevelMonteCarlo::Method(const double eps) {
logger->startMethodMSG();
logger->logMSGV1("eps: " + to_string(eps));
logger->StartMethodMsg();
logger->LogMsgv1("eps: " + to_string(eps));
bool converged = false;
while (!converged) {
for (auto &mc : mapMonteCarlo)
......@@ -64,12 +64,12 @@ void MultilevelMonteCarlo::Method(const double eps) {
Vector u((*graphs)[mapMonteCarlo.rbegin()->first - pLevel]);
u = 0.0;
wrapUpResults(u, value, cost, levels, numsamples);
logger->endMethodMSG();
logger->EndMethodMsg();
}
void MultilevelMonteCarlo::Method(const vector<double> &eps_lst) {
logger->startMethodMSG();
// logger->increase_indent();
logger->StartMethodMsg();
// logger->IncreaseIndent();
for (auto &eps : eps_lst) {
initializeMapMonteCarlo();
initializeValues();
......@@ -79,8 +79,8 @@ void MultilevelMonteCarlo::Method(const vector<double> &eps_lst) {
valueOverEpsilon.push_back(value);
costOverEpsilon.push_back(cost);
}
// logger->decrease_indent();
logger->endMethodMSG();
// logger->DecreaseIndent();
logger->EndMethodMsg();
}
void MultilevelMonteCarlo::estimateExponents(bool excludeBaseLevel) {
......@@ -103,7 +103,7 @@ void MultilevelMonteCarlo::estimateExponents(bool excludeBaseLevel) {
v = linear_fit(level_lst, costs);
gamma = v.front();
logger->logMSGV2("alpha: " + to_string(alpha) +
logger->LogMsgv2("alpha: " + to_string(alpha) +
" beta: " + to_string(beta) +
" gamma: " + to_string(gamma));
}
......@@ -122,7 +122,7 @@ void MultilevelMonteCarlo::updateSampleAmount(const double &eps) {
string msg = "dM:";
for (auto &mc:mapMonteCarlo) msg += " " + to_string(mc.second->dM);
logger->logMSGV2(msg);
logger->LogMsgv2(msg);
}
bool MultilevelMonteCarlo::checkForNewLevel() {
......@@ -147,7 +147,7 @@ double MultilevelMonteCarlo::estimateNumericalError() {
exponent--;
}
logger->logMSGV2("err: " + to_string(maxErr));
logger->LogMsgv2("err: " + to_string(maxErr));
return maxErr;
}
......@@ -156,7 +156,7 @@ void MultilevelMonteCarlo::appendLevel(double eps) {
if (L > maxLevel) {
Exit ("Maximum level has been reached.")
} else {
logger->logMSGV2("new level: " + to_string(L));
logger->LogMsgv2("new level: " + to_string(L));
mapMonteCarlo[L] = getMonteCarlo(L, 0, false);
mapMonteCarlo[L]->varY = mapMonteCarlo[L - 1]->varY / pow(2.0, beta);
mapMonteCarlo[L]->avgCost = mapMonteCarlo[L - 1]->avgCost * pow(2.0, gamma);
......
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