public static void main(String[] args) {
		if (args.length != 5) {
			System.err.println("Error!");
			System.exit(0);
		}
		String file = args[0];
		String net = args[1];
		int n = Integer.parseInt(args[2]);
		double merr = Double.parseDouble(args[3]);
		int maxiter = Integer.parseInt(args[4]);
		String[] parts = net.split("-");
		String[] count = parts[1].split("x");
		int sz = count.length;
		int[] layers = new int[sz];
		for (int i = 0; i < sz; i++) {
			layers[i] = Integer.parseInt(count[i]);
		}
		
		if (parts[0].equalsIgnoreCase("tdnn")) { // ***TDNN***
			IReadOnlyDataset dataset = loadData(file, layers[0], LIMIT);
			ITransferFunction[] tf = new ITransferFunction[sz - 1];
			for (int i = 0; i < sz - 1; i++) {
				tf[i] = new HyperbolicTangent();
			}
			TDNN tdnn = new TDNN(layers, tf, dataset);
			int weightsCount = tdnn.getWeightsCount();
			// ***
			Strategy strategy = new DErand2(F);
			// ***
			ICrossover crossover = new ExponentialCrossover(CR);
			double[] lb = new double[weightsCount];
			double[] ub = new double[weightsCount];
			Arrays.fill(lb, LOWER_BOUND);
			Arrays.fill(ub, UPPER_BOUND);
			Solution lowerBound = new Solution(lb);
			Solution upperBound = new Solution(ub);
			Solution sol = new DE(tdnn, n, merr, maxiter, false, initPop(n, weightsCount), strategy, crossover, lowerBound, upperBound).run();
			System.out.println("Error: " + Math.abs(sol.getFitness()));
			System.out.println(sol.toString());
		} else if (parts[0].equalsIgnoreCase("elman")) { // ***ELMAN***
			if (layers[0] != 1 || layers[sz - 1] != 1) {
				System.err.println("NN invalid input and output!");
				System.exit(0);
			}
			IReadOnlyDataset dataset = loadData(file, LIMIT);
			ITransferFunction[] tf = new ITransferFunction[sz - 1];
			for (int i = 0; i < sz - 1; i++) {
				tf[i] = new HyperbolicTangent();
			}
			ElmanNN elman = new ElmanNN(layers, tf, dataset);
			int weightsCount = elman.getWeightsCount();
			// ***
			Strategy strategy = new DEbest1(F);
			// ***
			ICrossover crossover = new ExponentialCrossover(CR);
			int conSize = layers[1];
			int size = weightsCount + conSize * conSize + conSize;
			double[] lb = new double[size];
			double[] ub = new double[size];
			Arrays.fill(lb, LOWER_BOUND);
			Arrays.fill(ub, UPPER_BOUND);
			Solution lowerBound = new Solution(lb);
			Solution upperBound = new Solution(ub);
			Solution sol = new DE(elman, n, merr, maxiter, false, initPop(n, size), strategy, crossover, lowerBound, upperBound).run();
			System.out.println("Error: " + Math.abs(sol.getFitness()));
			System.out.println(sol.toString());
		} else { // ***ERROR***
			System.err.println("Net error!");
			System.exit(0);
		}
	}