@Override public Collection<Argument> getChildren(Node node) { if(!(node instanceof Argument)) throw new IllegalArgumentException("Node of type argument expected"); return this.getAttacked((Argument)node); }
@Override public Collection<Argument> getNeighbors(Argument node) { Set<Argument> neighbours = new HashSet<Argument>(); neighbours.addAll(this.getAttacked(node)); neighbours.addAll(this.getAttackers(node)); return neighbours; }
/** * 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. * @param visited already visited arguments. * @return "true" iff "arg1" indirectly attacks "arg2". */ private boolean isIndirectAttack(Argument arg1, Argument arg2, Set<Argument> visited){ if(this.isAttackedBy(arg2,arg1)) return true; visited.add(arg1); Set<Argument> attackedArguments = this.getAttacked(arg1); attackedArguments.removeAll(visited); for(Argument attacked : attackedArguments){ if(this.isSupport(attacked, arg2)) return true; } return false; }
/** * 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; }
new_in.addAll(ext); for(Argument a: ext) attacked.addAll(theory.getAttacked(a)); new_out.addAll(attacked); for(Argument a: subTheory)
for(Argument a: ((DungTheory)params.get(GroundedGameGenerator.PARAM_UNIVERSALTHEORY)).getAttacked(rec.getPreimage(vArg))){ if(arguments.contains(a)) if(this.getRandom().nextDouble() <= this.config.percentageVirtualAttacks)