@Override public DungTheory next(Argument arg){ DungTheory theory = new DungTheory(); if(this.params.enforceTreeShape){ boolean inExtension = false; do{ theory = this.generateTreeShape(arg); inExtension = new SimpleGroundedReasoner().query(theory,arg); }while(!inExtension); return theory; } theory.add(arg); for(int i = 1; i < this.params.numberOfArguments; i++) theory.add(new Argument("a" + i)); for(Argument a: theory) for(Argument b: theory){ if(a == b && this.params.avoidSelfAttacks) continue; if(this.random.nextDouble() <= this.params.attackProbability){ Attack att = new Attack(a,b); theory.add(att); //Check whether this makes the argument out if(!new SimpleGroundedReasoner().query(theory,arg)) theory.remove(att); } } return theory; }