Пример #1
0
 /** Returns a copy of the instance of the class. */
 @Override
 public Infestation clone() {
   Infestation occ = new Infestation();
   occ.ageOfInfestation = ageOfInfestation;
   if (disperser != null) {
     occ.disperser = disperser.clone();
   }
   occ.infested = infested;
   occ.stageOfInfestation = stageOfInfestation;
   occ.maxInfestation = maxInfestation;
   occ.maxControl = maxControl;
   occ.wasControlled = wasControlled;
   occ.wasInfested = wasInfested;
   occ.species = species;
   occ.parent = parent;
   occ.freezeManagement = freezeManagement;
   List<Coordinate> propagules_c = new ArrayList<Coordinate>();
   for (Coordinate c : propagules) {
     propagules_c.add((Coordinate) c.clone());
   }
   for (ControlType s : controls.keySet()) {
     occ.controls.put(s, controls.get(s).longValue());
   }
   occ.propagules = propagules_c;
   return occ;
 }
Пример #2
0
 /** Performs dispersal operations associated with the Occupant. */
 public void disperse() {
   try {
     propagules = disperser.disperse();
   } catch (NullPointerException e) {
     e.printStackTrace();
   }
 }