Skip to content

Commit

Permalink
improve output
Browse files Browse the repository at this point in the history
  • Loading branch information
jessLryan committed Apr 8, 2024
1 parent 74d6bc4 commit 37c4c72
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
25 changes: 12 additions & 13 deletions src/main/java/algorithmRunner/RunResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import graph.GraphStatistics;
import graph.GraphType;

import java.time.LocalDate;
import java.time.LocalDateTime;

public class RunResult {
private final LocalDate date;
private final LocalDateTime datetime;
private final GraphStatistics patternGraphStatistics;
private final GraphStatistics hostGraphStatistics;
private Integer numberOfHighDegreeVertices = null;
Expand All @@ -22,21 +22,20 @@ public RunResult(Graph hostGraph,
String patternGraphFilepath) {
patternGraphStatistics = new GraphStatistics(patternGraph, patternGraphFilepath, GraphType.PATTERN_GRAPH);
hostGraphStatistics = new GraphStatistics(hostGraph, hostGraphFilepath, GraphType.HOST_GRAPH);
date = LocalDate.now();
datetime = LocalDateTime.now();
}

@Override
public String toString() {
return "RunResult{" +
"date: " + date +
", pattern graph statistics: " + patternGraphStatistics +
", host graph statistics: " + hostGraphStatistics +
", number of high degree vertices parameter: " + numberOfHighDegreeVertices +
", maximum degree of remaining host graph: " + maximumDegreeOfRemainingVertices +
", run status: " + status +
", count: " + count +
", runtime in milliseconds: " + runtimeInMilliseconds +
'}';
return "RunResult\n" +
"datetime: " + datetime + "\n" +
"pattern graph statistics: " + patternGraphStatistics + "\n" +
"host graph statistics: " + hostGraphStatistics + "\n" +
"number of high degree vertices parameter: " + numberOfHighDegreeVertices + "\n" +
"maximum degree of remaining host graph: " + maximumDegreeOfRemainingVertices + "\n" +
"run status: " + status + "\n" +
"count: " + count + "\n" +
"runtime in milliseconds: " + runtimeInMilliseconds;
}

public void setMaximumDegreeOfRemainingVertices(int maximumDegreeOfRemainingVertices) {
Expand Down
14 changes: 6 additions & 8 deletions src/main/java/graph/GraphStatistics.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ public GraphStatistics(Graph graph, String filepath, GraphType graphType) {

@Override
public String toString() {
return "GraphStatistics{" +
"filepath: " + filepath + '\'' +
", graph type: " + graphType +
", order: " + order +
", number of edges: " + numEdges +
", average degree: " + averageDegree +
", maximum degree: " + maxDegree +
'}';
return "filepath: " + filepath + "\n" +
"graph type: " + graphType + "\n" +
"order: " + order + "\n" +
"number of edges: " + numEdges + "\n" +
"average degree: " + averageDegree + "\n" +
"maximum degree: " + maxDegree + "\n" ;
}
}

0 comments on commit 37c4c72

Please sign in to comment.