Skip to content

Commit 60fdacd

Browse files
author
“jklein94”
committed
Added missing javadoc AigSerialisationPlotter.java
1 parent be3a3e1 commit 60fdacd

File tree

1 file changed

+54
-7
lines changed

1 file changed

+54
-7
lines changed

org-tweetyproject-arg-dung/src/main/java/org/tweetyproject/arg/dung/serialisability/util/AigSerialisationPlotter.java

Lines changed: 54 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,69 @@
1616
import java.nio.file.Path;
1717
import java.nio.file.Paths;
1818

19+
/**
20+
* Abstract plotter for visualizing the serialisation of Dung argumentation frameworks.
21+
* <p>
22+
* This class extends {@link AigGraphPlotter} to provide visualization capabilities
23+
* specifically tailored for Dung theories and their serialisations under various
24+
* argumentation semantics.
25+
* </p>
26+
*
27+
* <p>
28+
* It offers a static utility method to generate and display an HTML visualization
29+
* of both the original argumentation framework and its serialisation graph,
30+
* facilitating comparative analysis.
31+
* </p>
32+
*
33+
* @author (your name or team)
34+
*/
35+
public abstract class AigSerialisationPlotter extends AigGraphPlotter<DungTheory, Argument> {
1936

20-
public abstract class AigSerialisationPlotter extends AigGraphPlotter<DungTheory,Argument> {
21-
37+
/**
38+
* Constructs a new {@code AigSerialisationPlotter} for the given Dung theory.
39+
*
40+
* <p>
41+
* This initializes the plotter with the specified argumentation framework,
42+
* allowing for the visualization of its structure or serialisation.
43+
* </p>
44+
*
45+
* @param graph the Dung argumentation framework to be visualized.
46+
*/
2247
public AigSerialisationPlotter(DungTheory graph) {
2348
super(graph);
2449
}
2550

51+
/**
52+
* Visualizes a Dung argumentation framework along with its serialisation
53+
* with respect to a given argumentation semantics.
54+
*
55+
* <p>
56+
* This method uses a {@link SerialisedExtensionReasoner} to compute
57+
* the serialisation graph of the given theory under the specified semantics.
58+
* It then renders both the original argumentation framework and the
59+
* serialisation graph side by side in a generated HTML file using
60+
* {@link AigGraphPlotter}.
61+
* </p>
62+
*
63+
* <p>
64+
* The resulting visualization is written to {@code index.html}
65+
* and automatically opened in the system's default web browser.
66+
* </p>
67+
*
68+
* @param theory the Dung theory to be visualized.
69+
* @param semantics the argumentation semantics to use for computing the
70+
* serialisation.
71+
* @throws RuntimeException if an I/O error occurs during file handling.
72+
*/
2673
public static void showSerialisation(DungTheory theory, Semantics semantics) {
2774
SerialisedExtensionReasoner reasoner = new SerialisedExtensionReasoner(semantics);
2875

2976
SerialisationGraph serialisation = reasoner.getSerialisationGraph(theory);
30-
SerialisationState root = new SerialisationState(theory, new Extension<>(), reasoner.isTerminal(theory, new Extension<>()));
77+
SerialisationState root = new SerialisationState(theory, new Extension<>(),
78+
reasoner.isTerminal(theory, new Extension<>()));
3179

32-
AigGraphPlotter<DungTheory,Argument> plotter1 = new AigGraphPlotter<>(theory);
33-
AigGraphPlotter<SerialisationGraph,SerialisationState> plotter2 = new AigGraphPlotter<>(serialisation);
80+
AigGraphPlotter<DungTheory, Argument> plotter1 = new AigGraphPlotter<>(theory);
81+
AigGraphPlotter<SerialisationGraph, SerialisationState> plotter2 = new AigGraphPlotter<>(serialisation);
3482
plotter2.makeLeveled(root);
3583

3684
Path outputPath = Paths.get("index.html");
@@ -39,8 +87,7 @@ public static void showSerialisation(DungTheory theory, Semantics semantics) {
3987
String output = String.format(template,
4088
plotter1.write(), plotter2.write(),
4189
getResource("aiggraph/favicon.ico"), getResource("aiggraph/style.css"),
42-
getResource("aiggraph/load-mathjax.js"), getResource("aiggraph/graph-component.js")
43-
);
90+
getResource("aiggraph/load-mathjax.js"), getResource("aiggraph/graph-component.js"));
4491

4592
Files.writeString(outputPath, output);
4693

0 commit comments

Comments
 (0)