~dvedder95/ecologia/ecologia-base

« back to all changes in this revision

Viewing changes to src/model/Simulator.java

  • Committer: Daniel Vedder
  • Date: 2016-05-29 20:47:51 UTC
  • Revision ID: d.vedder@web.de-20160529204751-gik6qtg01dqztkc0
Tags: 1.0
Ecologia 1.0 - finally completed after two years!

Updated documentation, minor bug fixes and lots of code cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
                        }
58
58
                }
59
59
                averageDensity = averageDensity/(xsize*ysize);
 
60
                World.getInstance().setAverageGrassDensity((int) averageDensity);
60
61
                
61
62
                //Each animal has its turn
62
63
                EcologiaIO.debug("Simulator: Updating herbivores.");
68
69
                        carnivorePopulation.get(c).update();
69
70
                }
70
71
                double hunt_success = (double) Carnivore.fights_won / (double) Carnivore.total_fights;
 
72
                //XXX Should this be changed to an analysis() or debug() call, or moved to Ecologia.java?
71
73
                EcologiaIO.log("Carnivore hunt success rate: "+(int) (hunt_success*100)+"%");
72
 
                
73
 
                World.getInstance().setAverageGrassDensity((int) averageDensity);
74
 
                EcologiaIO.log("Average grass density: "+(int) averageDensity+"%");
75
 
 
76
 
                EcologiaIO.log("Generation counter: "+World.getInstance().getGeneration());
77
74
 
78
75
                updateWorld();
79
76
        }