Here you can find the source of saveProbabilityData(String file, double[] probabilities, double start, double dt)
Parameter | Description |
---|---|
file | a parameter |
probabilities | a parameter |
d | a parameter |
public static void saveProbabilityData(String file, double[] probabilities, double start, double dt)
//package com.java2s; /*//from www. j av a 2 s. c o m * Michele Loreti, Concurrency and Mobility Group * Universit? di Firenze, Italy * (C) Copyright 2013. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Michele Loreti */ import java.io.File; import java.io.IOException; import java.io.PrintWriter; public class Main { /** * @param file * @param probabilities * @param d */ public static void saveProbabilityData(String file, double[] probabilities, double start, double dt) { try { File dataFile = new File(file + File.separator + "output.dat"); PrintWriter writer = new PrintWriter(dataFile); for (int i = 0; i < probabilities.length; i++) { writer.println((start + (i * dt)) + "\t" + probabilities[i]); } writer.close(); } catch (IOException e) { e.printStackTrace(); } } }