public static void main(String[] args) throws Exception {

		BeeCommandLineParser arguments = BeeCommandLineParser.parse(args);

		// average available surface: 29ha
		// 1ha = 10000 square meters -> 29ha = 290000 square meters ->
		// sqrt(290000) approximately 540m -> Env(-270, 270, -270, 270)
		BeeSimulation simulation = new BeeSimulation(arguments.getNumberOfGroups(), arguments.getGroupSize(),
				(arguments.showGui()) ? new Environment(-30, 30, -30, 30) : new Environment(-270, 270, -270, 270));

		if (arguments.showGui()) {
			simulation.addEventListener(new VisualisationEventListener(simulation));
		}

		if (arguments.generateReport()) {
			try {
				simulation.addEventListener(new ReportEventListener("report.csv", simulation));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		if (arguments.showControls()) {
			simulation.setVisible(true);
		} else {
			simulation.run();
		}
	}