@Override
	public void notify(PositionedEntity e) {
		Environment environment = _simulation.environment();
		double currentTime = (Math.round(e.getTimeNow() * 1000)) / 1000d;
		int numBees = environment.getNumberOfBees();
		int numHives = environment.getNumberOfHives();
		int numFlowers = environment.getNumberOfFlowers();
		int numInfected = environment.getNumberOfInfectedBees();
		double infectionRatio = (double) numInfected / (double) numBees;
		List<Flower> flowers = environment.getFlowers();
		double averageFlowerNectarRatio = 0;
		for (Flower f : flowers) {
			averageFlowerNectarRatio += (double) f.getNectarAmount() / (double) f.getMaxNectarAmount();
		}
		averageFlowerNectarRatio /= flowers.size();
		double collapsedHiveRatio = (double) environment.getNumberOfCollapsedHives()
				/ (double) environment.getNumberOfHives();

		if (_lastNotificationTime == currentTime) {
			_states.remove(_states.size() - 1);
		}
		_states.add(SimulationState.Builder.time(currentTime).numberOfBees(numBees).numberOfFlowers(numFlowers)
				.numberOfHives(numHives).numberOfInfectedBees(numInfected).beeInfectionRatio(infectionRatio)
				.averageFlowerNectarRatio(averageFlowerNectarRatio).collapsedHiveRatio(collapsedHiveRatio).build());
		_lastNotificationTime = currentTime;

		if (numBees == 0 && _lastNotificationTime > 0d) {
			_simulation.stopSimulation();
		}
	}