@Override
	public void run() {
		GameConfiguration conf = WDStack.get(WDStack.size() - 1)
				.configuration();
		if (!running) {
			running = true;
			while (running) {
				try {
					if (pause) {
						synchronized (this) {
							wait();
						}
					}
					world.step();
					if (world.getDead().size() == conf.getAgentCount()) {
						List<Genotype> parents = new ArrayList<Genotype>(
								conf.getWinnerCount());
						generation++;
						for (int i = 0; i < conf.getWinnerCount(); i++) {
							Agent a = (Agent) world.getDead().get(
									world.getDead().size() - (1 + i));
							parents.add(a.getGenotype());
						}
						WorldDescriptor braveNewWorld = new WorldDescriptor(
								parents, conf);
						WDStack.get(WDStack.size()-1).setFitness(this.getWorldAge());
						WDStack.add(braveNewWorld);
						world = new GameWorld(braveNewWorld);
					}
					// if ((System.currentTimeMillis()-lastRendered)>100.0/6.0)
					{
						Game.getInstance().getUI().render();
					}
					Thread.sleep(delay);
				} catch (InterruptedException e) {
					e.printStackTrace();
				} catch (GenomSizeNotMatchException e) {
					logger.error("Genom size not match at simulation.");
					logger.warn("There exception shouldn't be thrown, because we use the current world to generate a new one.");
				} catch (WeigthNumberNotMatchException e) {
					logger.error("Genom size not match at simulation.");
					logger.warn("There exception shouldn't be thrown, because we use the current world to generate a new one.");					
				}
			}
		}
	}