Skip to content

Commit c872a0c

Browse files
author
“jklein94”
committed
Added missing javadoc EafPreferenceRepresentationExample.java
1 parent bd8af6b commit c872a0c

File tree

1 file changed

+35
-12
lines changed

1 file changed

+35
-12
lines changed

org-tweetyproject-arg-eaf/src/main/java/org/tweetyproject/arg/eaf/examples/EafPreferenceRepresentationExample.java

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,49 +24,72 @@
2424
import org.tweetyproject.arg.eaf.syntax.EpistemicArgumentationFramework;
2525

2626
/**
27-
*
27+
* Demonstrates how epistemic preferences can be encoded within
28+
* an {@link EpistemicArgumentationFramework} using logical implication
29+
* and justification state preferences.
30+
*
31+
* <p>This example illustrates:
32+
* <ul>
33+
* <li>How preferences over arguments can be modeled using constraints like {@code [](in(a) => in(r))}</li>
34+
* <li>How justification state preferences can be expressed, e.g., requiring {@code und(a)} to be accepted if {@code in(a)} is accepted</li>
35+
* <li>How epistemic constraints influence the resulting labellings under different semantics</li>
36+
* </ul>
37+
*
38+
* <p>The scenario is based on a simple Dung theory with two mutually attacking arguments.
2839
*/
2940
public class EafPreferenceRepresentationExample {
3041

31-
/**
32-
* @param args
33-
*/
42+
/**
43+
* Entry point for the example demonstrating the encoding of preferences
44+
* in an epistemic argumentation framework using logical implication over
45+
* acceptance and justification states.
46+
*
47+
* <p>Three different EAFs are created with varying constraints to express:
48+
* <ul>
49+
* <li>Simple preference over arguments (e.g., "if a is accepted, then r should be accepted")</li>
50+
* <li>Conditional preference (e.g., "if a is accepted or undecided, then r should be accepted")</li>
51+
* <li>Preference over justification states (e.g., "in(a) implies und(a)")</li>
52+
* </ul>
53+
* The resulting epistemic labelling sets under different semantics (complete, stable) are printed to the console.
54+
*
55+
* @param args command-line arguments (not used).
56+
*/
3457
public static void main(String[] args) {
3558
Argument a = new Argument("a");
3659
Argument b = new Argument("b");
3760
Argument c = new Argument("c");
3861
Argument d = new Argument("d");
3962
Argument r = new Argument("r");
40-
63+
4164
DungTheory af = new DungTheory();
42-
65+
4366
af.add(a);
4467
af.add(r);
45-
68+
4669
af.addAttack(a,r);
4770
af.addAttack(r,a);
4871

4972

5073
String constEAF1 = "[](in(a)=>in(r))";
51-
EpistemicArgumentationFramework eaf1 = new EpistemicArgumentationFramework(af, constEAF1);
52-
74+
EpistemicArgumentationFramework eaf1 = new EpistemicArgumentationFramework(af, constEAF1);
75+
5376
System.out.println("Preference over arguments can be represented using the implication operator, where [](in(a)=>in(r)) means that the preferred argument r should be accepted, whenever a is accepted.");
5477
System.out.print("The EAF: \n"+ eaf1.prettyPrint() +"\n\nhas the following stable labelling set:");
5578
System.out.println(eaf1.getWEpistemicLabellingSets(Semantics.ST));
5679
System.out.print("This EAF has the following complete labelling set:");
5780
System.out.println(eaf1.getWEpistemicLabellingSets(Semantics.CO));
5881
System.out.println();
59-
82+
6083
String constEAF2 = "[](in(a)||und(a)=>in(r))";
6184
EpistemicArgumentationFramework eaf2 = new EpistemicArgumentationFramework(af, constEAF2);
6285
System.out.print("The EAF: \n"+ eaf2.prettyPrint() +"\n\nhas the following complete labelling set:");
6386
System.out.println(eaf2.getWEpistemicLabellingSets(Semantics.CO));
64-
87+
6588
System.out.println("\nPreference over justification states can be represented using the implication operator.");
6689
System.out.println("For example, [](in(a) => und(a)) means that the less preferred justification state in(a) is only acceptable if the preferred state und(a) is also accepted.");
6790
String constEAF3 = "[](in(a)=>und(a)) && [](out(a)=>und(a)) && [](in(r)=>und(r)) && [](out(r)=>und(r))";
6891
EpistemicArgumentationFramework eaf3 = new EpistemicArgumentationFramework(af, constEAF3);
69-
92+
7093
System.out.print("The EAF: \n"+ eaf3.prettyPrint() +"\n\nhas the following complete labelling set:");
7194
System.out.println(eaf3.getWEpistemicLabellingSets(Semantics.CO));
7295

0 commit comments

Comments
 (0)