public void train(Data trainingData) 
	{
    	input_data = trainingData.getInputVector();
		output_data = trainingData.getOutputVector();
		
		for( int run = 0; run < runtime; run++ ) {
			if(pause) {
				continue;
			}
			if(terminate) {
				break;
			}			
			double start = System.currentTimeMillis();
			initializePopulation();
			memorizeBestSource();
			
			for( int cycle = 0; cycle < maxCycle; ) {
				if(pause) {
					continue;
				}
				if(terminate) {
					break;
				}
				sendEmployedBees();
				calculateProbabilities();
				sendOnlookerBees();
				memorizeBestSource();
				sendScoutBees();
				ExperimentPane.getInstance().incrementCycle(cycle+1);
				cycle++;
			}
			ExperimentPane.getInstance().incrementRuntime(run+1);
			GlobalMins[run] = GlobalMin;
			meanRun += GlobalMin;
			
			Params[run] = GlobalParams;
			if( GlobalMin <= bestMin ){
				bestMin = GlobalMin;
				bestIndex = run;
			}
			double elapsedTime = (System.currentTimeMillis() - start) / 1000;
			
			ExperimentPane.getInstance().returnResult(/*bestMin*/GlobalMin, Params[bestIndex], elapsedTime, run+1);
		}
		ExperimentPane.getInstance().resetButtons();
		if(terminate)
			new MessageDialog("The optimization has been stopped.").setVisible(true);
		else
			new MessageDialog("Done optimizing.").setVisible(true);
	}