/** * Checks whether "arg1" indirectly attacks "arg2", i.e. whether there * is an odd-length path from "arg1" to "arg2". * @param arg1 an AbstractArgument. * @param arg2 an AbstractArgument. * @return "true" iff "arg1" indirectly attacks "arg2". */ public boolean isIndirectAttack(Argument arg1, Argument arg2){ return this.isIndirectAttack(arg1, arg2, new HashSet<Argument>()); }
/** * Checks whether "arg1" supports "arg2", i.e. whether there * is an even-length path from "arg1" to "arg2". * @param arg1 an AbstractArgument. * @param arg2 an AbstractArgument. * @param visited already visited arguments. * @return "true" iff "arg1" supports "arg2". */ private boolean isSupport(Argument arg1, Argument arg2, Set<Argument> visited){ if(arg1.equals(arg2)) return true; visited.add(arg1); Set<Argument> attackedArguments = this.getAttacked(arg1); attackedArguments.removeAll(visited); for(Argument attacked : attackedArguments){ if(this.isIndirectAttack(attacked, arg2)) return true; } return false; }
/** * Computes the attack set of this agent's focal element wrt. its view, * i.e. the set of basic arguments "arg" such that there are argumentation * structures "AS1" and "AS2" with "arg" in "AS1", "AS1" indirectly attacks "AS2" * and the claim of "AS2" is the agent's focal element. * @return the attack set of this agent's focal element wrt. its view. */ protected Set<Argument> attackSet(){ DungTheory commonView = this.getCommonView().toDungTheory(); Set<Argument> attackSet = new HashSet<Argument>(); for(Argument a : commonView){ ArgumentStructure arg1 = (ArgumentStructure) a; if(arg1.getClaim().equals(this.focalElement)){ for(Argument b: commonView){ ArgumentStructure arg2 = (ArgumentStructure) b; if(commonView.isIndirectAttack(arg2, arg1)){ attackSet.addAll(arg2); } } } } return attackSet; }