public static void arquivoPerceptron(String nome, Perceptron perceptron,
			Double[][] amostras, Double[] esperado, Double[][] testes,
			Double taxa, Integer maxEpocas) {
		try {
			FileWriter fileWriter = new FileWriter(nome);
			BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);

//			for (int i = 0; i < 5; i++) {
				bufferedWriter.write("\n\nTreinamento \n");
//				perceptron.gerarPesos(amostras[0].length);
				bufferedWriter.write("Pesos iniciais\n");
				bufferedWriter.write(perceptron.getPesoBias().toString().replace(".", ",") + ";");
				for (Double peso : perceptron.getPesos()) {
					bufferedWriter.write(peso.toString().replace(".", ",")
							+ ";");
				}
				bufferedWriter.write("\n");
				perceptron.treinamento(amostras, esperado, taxa, maxEpocas);

				bufferedWriter.write("Pesos Finais\n");
				bufferedWriter.write(perceptron.getPesoBias().toString().replace(".", ",") + ";");
				for (Double peso : perceptron.getPesos()) {
					bufferedWriter.write(peso.toString().replace(".", ",")
							+ ";");
				}
				bufferedWriter.write("\n"+ perceptron.getStrResult());

//				bufferedWriter.write("Epocas = ;" + perceptron.getQuantEpocas()
//						+ "\n");
				
				
				if(testes != null){
					bufferedWriter.write("Saida\n");
					for (int j = 0; j < testes.length; j++) {
						perceptron.executar(testes[j]);
						bufferedWriter.write(perceptron.getSaida().toString().replace(".", ",")+";");
					}
				}

//			}

			bufferedWriter.close();
			fileWriter.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}