public void updateStatus()
	{
		Market mkt = Market.getInstance();
		Parameter p = Parameter.getInstance();
		String param = p.getParam("asset treshold");
		double tresh = Double.valueOf(param);
		int[] n = new int[2];
		double[][] list = new double[size][mkt.assets.size()];
		double[] centroid = new double[mkt.assets.size()];
		
		Collections.sort(individual);
		//TODO: Make sure that sorting global list does not mess up local lists!
		
		avg_fitness[currgen-1] = 0;
		terminals[currgen-1] = 0;
		bigterminals[currgen-1] = 0;
		nodes[currgen-1] = 0;
		introns[currgen-1] = 0;
		memevalue[currgen-1][0] = 0;
		memevalue[currgen-1][1] = 0;
		citytotal[currgen-1] = 0;
		
		for (int i = 0; i < max_X; i++)
			for (int j = 0; j < max_Y; j++)
			{
				ArrayList<MemeNode> m = (ArrayList<MemeNode>)terrain[i][j];
				memevalue[currgen-1][0] += m.size()*Double.parseDouble(xparameter[i]);
				memevalue[currgen-1][1] += m.size()*Double.parseDouble(yparameter[j]);
				citypop[currgen-1][i][j] = m.size();
				cityfitness[currgen-1][i][j] = 0;
				for(int k = 0; k < m.size(); k++)
				{
					cityfitness[currgen-1][i][j]+= m.get(k).fitness / m.size();
				}
				if (m.size() > 0) citytotal[currgen-1]++;
				
			}
		
		for (int i = 0; i < size; i++)
		{
			// calculating centroid;
			Portfolio port = individual.get(i).generatePortfolio();				
			for (int j = 0; j < centroid.length; j++)
			{
				list[i][j] = port.getWeightByIndex(j);
				centroid[j] += list[i][j]/size;
			}
			
			avg_fitness[currgen-1] += individual.get(i).fitness;
			terminals[currgen-1] += individual.get(i).countAsset(0.0);
			bigterminals[currgen-1] += individual.get(i).countAsset(tresh);
			n = individual.get(i).countNodes();
			nodes[currgen-1] += n[0];
			introns[currgen-1] += n[1];
		}
		
		diversity[currgen-1] = 0;
		for(int i = 0; i < size; i++)
			for(int j = 0; j < centroid.length; j++)
			{
				diversity[currgen-1] += Math.pow(centroid[j] - list[i][j],2);
			}
		
		max_fitness[currgen-1] = individual.get(0).fitness;
		avg_fitness[currgen-1] /= size;
		terminals[currgen-1] /= size;
		bigterminals[currgen-1] /= size;
		nodes[currgen-1] /= size;
		introns[currgen-1] /= size;
		memevalue[currgen-1][0] /= size;
		memevalue[currgen-1][1] /= size;
	
	}