Skip to content

Commit

Permalink
Refactor logging statement in AgingScenario::compute_probabilities() …
Browse files Browse the repository at this point in the history
…function
  • Loading branch information
janjurca committed Apr 19, 2024
1 parent fe3a019 commit 756ee69
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/scenarios/aging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,9 @@ void AgingScenario::compute_probabilities(std::map<std::string, double>& probabi
probabilities["p1"] = 1.0;

if (getParameter("features-log-probs").get_bool()) {
std::string logMessage = fmt::format("Capacity: {} MB | available: {} MB | pC: {:.4f}, pD: {:.4f}, pA: {:.4f}, sum p {:.4f} ", fs_status.capacity / 1024 / 1024, fs_status.available / 1024 / 1024,
probabilities["pC"], probabilities["pD"], probabilities["pA"], probabilities["pC"] + probabilities["pD"] + probabilities["pA"]);
std::string logMessage
= fmt::format("Capacity: {} MB | available: {} MB ({}) | pC: {:.4f}, pD: {:.4f}, pA: {:.4f}, sum p {:.4f} ", fs_status.capacity / 1024 / 1024, fs_status.available / 1024 / 1024,
fs_status.available, probabilities["pC"], probabilities["pD"], probabilities["pA"], probabilities["pC"] + probabilities["pD"] + probabilities["pA"]);
logMessage += fmt::format("Capacity: {} B | available: {} B ", fs_status.capacity, fs_status.available);
logMessage += fmt::format("pAM: {:.2f}, pAB: {:.2f}, pAS: {:.2f}, sum pA {:.2f} ", probabilities["pAM"], probabilities["pAB"], probabilities["pAS"],
probabilities["pAM"] + probabilities["pAB"] + probabilities["pAS"]);
Expand Down

0 comments on commit 756ee69

Please sign in to comment.