	public final void performJobUnit(final JobUnitContext context) {
		final BasicNetwork network = (BasicNetwork) context.getJobUnit();
		BufferedMLDataSet buffer = null;
		MLDataSet useTraining = this.training;
		if (this.training instanceof BufferedMLDataSet) {
			buffer = (BufferedMLDataSet) this.training;
			useTraining = buffer.openAdditional();
		}
		double error = Double.POSITIVE_INFINITY;
		for (int z = 0; z < this.weightTries; z++) {
			network.reset();
			final Propagation train = new ResilientPropagation(network,
					useTraining);
			final StopTrainingStrategy strat = new StopTrainingStrategy(0.001,
					5);
			train.addStrategy(strat);
			train.setNumThreads(1); 
			for (int i = 0; (i < this.iterations) && !getShouldStop()
					&& !strat.shouldStop(); i++) {
				train.iteration();
			}
			error = Math.min(error, train.getError());
		}
		if (buffer != null) {
			buffer.close();
		}
		if (!getShouldStop()) {
			this.high = Math.max(this.high, error);
			this.low = Math.min(this.low, error);
			if (this.hidden1Size > 0) {
				int networkHidden1Count;
				int networkHidden2Count;
				if (network.getLayerCount() > 3) {
					networkHidden2Count = network.getLayerNeuronCount(1);
					networkHidden1Count = network.getLayerNeuronCount(2);
				} else {
					networkHidden2Count = 0;
					networkHidden1Count = network.getLayerNeuronCount(1);
				}
				int row, col;
				if (this.hidden2Size == 0) {
					row = networkHidden1Count - this.hidden.get(0).getMin();
					col = 0;
				} else {
					row = networkHidden1Count - this.hidden.get(0).getMin();
					col = networkHidden2Count - this.hidden.get(1).getMin();
				}
				if ((row < 0) || (col < 0)) {
					System.out.println("STOP");
				}
				this.results[row][col] = error;
			}
			this.currentTry++;
			updateBest(network, error);
			reportStatus(
					context,
					"Current: "
							+ PruneIncremental.networkToString(network)
							+ "; Best: "
							+ PruneIncremental
									.networkToString(this.bestNetwork));
		}
	}

	public final void performJobUnit(final JobUnitContext context) {
		final BasicNetwork network = (BasicNetwork) context.getJobUnit();
		BufferedMLDataSet buffer = null;
		MLDataSet useTraining = this.training;
		if (this.training instanceof BufferedMLDataSet) {
			buffer = (BufferedMLDataSet) this.training;
			useTraining = buffer.openAdditional();
		}
		double error = Double.POSITIVE_INFINITY;
		for (int z = 0; z < this.weightTries; z++) {
			network.reset();
			final Propagation train = new ResilientPropagation(network,
					useTraining);
			final StopTrainingStrategy strat = new StopTrainingStrategy(0.001,
					5);
			train.addStrategy(strat);
			train.setNumThreads(1); 
			for (int i = 0; (i < this.iterations) && !getShouldStop()
					&& !strat.shouldStop(); i++) {
				train.iteration();
			}
			error = Math.min(error, train.getError());
		}
		if (buffer != null) {
			buffer.close();
		}
		if (!getShouldStop()) {
			this.high = Math.max(this.high, error);
			this.low = Math.min(this.low, error);
			if (this.hidden1Size > 0) {
				int networkHidden1Count;
				int networkHidden2Count;
				if (network.getLayerCount() > 3) {
					networkHidden2Count = network.getLayerNeuronCount(2);
					networkHidden1Count = network.getLayerNeuronCount(1);
				} else {
					networkHidden2Count = 0;
					networkHidden1Count = network.getLayerNeuronCount(1);
				}
				int row, col;
				if (this.hidden2Size == 0) {
					row = networkHidden1Count - this.hidden.get(0).getMin();
					col = 0;
				} else {
					row = networkHidden1Count - this.hidden.get(0).getMin();
					col = networkHidden2Count - this.hidden.get(1).getMin();
				}
				if ((row < 0) || (col < 0)) {
					System.out.println("STOP");
				}
				this.results[row][col] = error;
			}
			this.currentTry++;
			updateBest(network, error);
			reportStatus(
					context,
					"Current: "
							+ PruneIncremental.networkToString(network)
							+ "; Best: "
							+ PruneIncremental
									.networkToString(this.bestNetwork));
		}
	}
