private void collectiveInstinctiveMovement() {
		double[] m = new double[dimensions];
		double totalFitness = 0;
		
		// calculating m, the weighted average of individual movements 
		for (int i = 0; i < school.size(); i++) {
			Fish _fish = school.get(i);
			
			for (int j = 0; j < dimensions; j++) {
				m[j] += _fish.getDeltaPosition()[j] * _fish.getDeltaFitness();
			}
			
			totalFitness += _fish.getDeltaFitness();
		}
		
		// avoid division by 0
		if (totalFitness == 0) {
			return;
		}
		
		for (int i = 0; i < dimensions; i++) {
			m[i] /= totalFitness;
		}
		
		// applying m
		for (int i = 0; i < school.size(); i++) {
			Fish _fish = school.get(i);
			double[] schoolInstinctivePosition = new double[dimensions];
			
			for (int j = 0; j < dimensions; j++) {
				schoolInstinctivePosition[j] = _fish.getPosition()[j] + m[j];
				
				boolean collision = schoolInstinctivePosition[j] < -RANGE || schoolInstinctivePosition[j] > RANGE;
				if (collision)
				{
					schoolInstinctivePosition[j] = schoolInstinctivePosition[j] > 0 ? RANGE : - RANGE;
				}
			}
			
			_fish.setPosition(schoolInstinctivePosition);
		}
		
	}