예제 #1
0
 public void nextround(Simulation simulation) {
   int zufall = (int) (Math.random() * this.leute);
   Mensch mensch = this.menschen.get(zufall);
   if (mensch.isErkrankt()) {
     int zufall2 = (int) (Math.random() * 100);
     if (zufall2 <= simulation.prozent) {
       mensch.setErkrankt(false);
     } else {
       try {
         this.menschen.get(zufall + 1).setErkrankt(true);
       } catch (Exception x) {
       }
       try {
         this.menschen.get(zufall - 1).setErkrankt(true);
       } catch (Exception x) {
       }
     }
   }
 }