Skip to content

Commit

Permalink
minor text logger changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vovatrykoz committed Nov 14, 2024
1 parent f96033c commit 1eda71c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
17 changes: 12 additions & 5 deletions results.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
Results

Number of analyzed paths: 5
Number of unreachable paths: 2
- Number of analyzed paths: 5

- Number of unreachable paths: 2
Unreachable paths:
B
E

Number of reachable paths: 3
- Number of reachable paths: 3
Reachable paths:
A
C
D

Path with maximum latency over all reachable paths: D
Maximum latency over all reachable paths: 73
- Last-to-Last semantics:
Path with maximum latency over all reachable paths: D
Maximum latency over all reachable paths73

- Last-to-First semantics:
Path with maximum latency over all reachable paths: C
Maximum latency over all reachable paths: 53

26 changes: 15 additions & 11 deletions source/io/TextLogger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ void TextLogger::logValidInvalidPaths(
std::stringstream output;

output << "Results" << std::endl << std::endl;
output << "Number of analyzed paths: " << allPathsSet.size() << std::endl;
output << "- Number of analyzed paths: " << allPathsSet.size() << std::endl;

output << "Number of unreachable paths: " << invalidPathSet.size()
output << std::endl;

output << "- Number of unreachable paths: " << invalidPathSet.size()
<< std::endl;
output << "Unreachable paths: " << std::endl;
for (const auto& invalidPath : invalidPathSet) {
Expand All @@ -24,12 +26,14 @@ void TextLogger::logValidInvalidPaths(

output << std::endl;

output << "Number of reachable paths: " << validPathSet.size() << std::endl;
output << "- Number of reachable paths: " << validPathSet.size() << std::endl;
output << "Reachable paths: " << std::endl;
for (const auto& validPath : validPathSet) {
output << validPath.name() << std::endl;
}

output << std::endl;

std::ofstream outFile(this->pathToOutputFile, std::ios::app);

this->writeOutputToFile(output.str());
Expand All @@ -39,16 +43,16 @@ void TextLogger::logResults_LL(
const std::optional<TimedPath>& maximumLatencyPath) const {
std::stringstream output;

output << "Last-to-Last semantics:" << std::endl;
output << "- Last-to-Last semantics:" << std::endl;

if (maximumLatencyPath.has_value()) {
output << "Path with maximum latency over all reachable paths: "
output << " Path with maximum latency over all reachable paths: "
<< maximumLatencyPath.value().name() << std::endl;

output << "Maximum latency over all reachable paths"
output << " Maximum latency over all reachable paths"
<< maximumLatencyPath.value().endToEndDelay() << std::endl;
} else {
output << "Maximum latency over all reachable paths: 0 (are "
output << " Maximum latency over all reachable paths: 0 (are "
"there any valid paths?)"
<< std::endl;
}
Expand All @@ -62,18 +66,18 @@ void TextLogger::logResults_LF(
const std::optional<TimedPath>& maximumLatencyPath) const {
std::stringstream output;

output << "Last-to-First semantics:" << std::endl;
output << "- Last-to-First semantics:" << std::endl;

if (maximumLatencyPath.has_value()) {
output << "Path with maximum latency over all reachable paths: "
output << " Path with maximum latency over all reachable paths: "
<< maximumLatencyPath.value().name() << std::endl;

output
<< "Maximum latency over all reachable paths: "
<< " Maximum latency over all reachable paths: "
<< maximumLatencyPath.value().endToEndDelay() << std::endl;
} else {
output
<< "Maximum latency over all reachable paths: 0 (are "
<< " Maximum latency over all reachable paths: 0 (are "
"there any valid paths?)"
<< std::endl;
}
Expand Down

0 comments on commit 1eda71c

Please sign in to comment.