@Override public ExecutableDungTheory next(Collection<? extends Perceivable> percepts) { List<Graph<Argument>> allSub = new LinkedList<Graph<Argument>>(this.theory.getSubgraphs()); Random rand = new Random(); return new ExecutableDungTheory(new DungTheory(allSub.get(rand.nextInt(allSub.size())))); }
/** * Checks whether the given set of divisions is exhaustive wrt. the given theory. * @param divisions a set of divisions. * @param theory some aaf. * @param semantics some semantics * @return "true" if the given set of divisions is exhaustive. */ public static boolean isExhaustive(Collection<Division> divisions, DungTheory theory, Semantics semantics){ Collection<Graph<Argument>> subgraphs = theory.getSubgraphs(); // convert to Dung theories Collection<DungTheory> subtheories = new HashSet<DungTheory>(); for(Graph<Argument> g: subgraphs) subtheories.add(new DungTheory(g)); for(Division d: divisions){ subtheories.removeAll(d.getDividers(theory, semantics)); } return subtheories.isEmpty(); }
/** * Returns the dividers for this formula, i.e. all sub-theories of the given * theory such that this formula is satisfied by this sub-theory. * @param theory some argumentation framework * @param semantics some semantics * @return the set of dividers of this formula */ public Collection<DungTheory> getDividers(DungTheory theory, Semantics semantics){ Collection<DungTheory> result = new HashSet<DungTheory>(); for(Graph<Argument> g: theory.getSubgraphs()){ DungTheory sub = new DungTheory(g); LdoInterpretation i = new LdoInterpretation(sub,semantics); if(i.satisfies(this)) result.add(sub); } return result; }
public ExecutableDungTheory next(Collection<? extends Perceivable> percepts) { double bestUtility = Double.NEGATIVE_INFINITY; DungTheory e = new DungTheory(); for(Graph<Argument> subgraph: this.theory.getSubgraphs()){ DungTheory sub = new DungTheory(subgraph); Double d = this.util.getUtility(sub, this.semantics); if(d > bestUtility){ bestUtility = d; e = sub; } } return new ExecutableDungTheory(e); }
/** * Returns the dividers for this division, i.e. all sub-theories of the given * theory such that this division is in that sub-theories set of divisions. * @param theory some argumentation framework * @param semantics some semantics * @return the set of dividers of this devision */ public Collection<DungTheory> getDividers(DungTheory theory, Semantics semantics){ Collection<DungTheory> result = new HashSet<DungTheory>(); Collection<Graph<Argument>> subtheories = theory.getSubgraphs(); for(Graph<Argument> g: subtheories){ DungTheory sub = new DungTheory(g); for(Division d: Division.getDivisions(AbstractExtensionReasoner.getSimpleReasonerForSemantics(semantics).getModels(sub), sub)){ if(d.getFirst().equals(this.getFirst())){ Extension e = new Extension(this.getSecond()); e.retainAll(sub); if(e.equals(d.getSecond())) result.add(sub); } } } return result; }
refArgsUpper.add(a.getArgument()); if(formula instanceof LdoGraphBoxModality){ for(Graph<Argument> t: theory.getSubgraphs()){ DungTheory th = new DungTheory(t); if(th.containsAll(refArgsLower) && refArgsUpper.containsAll(th)){ for(Graph<Argument> t: theory.getSubgraphs()){ DungTheory th = new DungTheory(t); if(th.containsAll(refArgsLower) && refArgsUpper.containsAll(th)){ LdoFormula left = ((LdoRelation)formula).getLeft(); LdoFormula right = ((LdoRelation)formula).getRight(); for(Graph<Argument> t: theory.getSubgraphs()){
}else{ DungTheory th = new DungTheory(); Collection<Graph<Argument>> subgraphs = this.theory.getSubgraphs(); for(Graph<Argument> subgraph: subgraphs){ DungTheory sub = new DungTheory(subgraph);