Change export directory
This commit is contained in:
parent
505c1a9729
commit
97bdda71ce
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,5 +6,5 @@ build
|
||||
bin/
|
||||
.idea
|
||||
.project
|
||||
data.csv
|
||||
export
|
||||
.vscode
|
@ -1,11 +1,10 @@
|
||||
package fr.ntr;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@ -56,11 +55,12 @@ public class AccessPoint {
|
||||
*/
|
||||
public void startSimulation(int duration) {
|
||||
try{
|
||||
Files.deleteIfExists(Paths.get("data.csv"));
|
||||
this.outputDataFile = new FileOutputStream("data.csv", true);
|
||||
Files.deleteIfExists(Paths.get("export", this.users.size() + ".csv"));
|
||||
new File("export").mkdir();
|
||||
this.outputDataFile = new FileOutputStream("export" + File.separator + this.users.size() + ".csv", true);
|
||||
outputDataFile.write("tick;x;y;user;bandwidth;\n".getBytes());
|
||||
} catch(IOException e) {
|
||||
System.err.println("Cannot create the output file");
|
||||
System.err.println(e.getClass().getSimpleName() + " : " + e.getMessage());
|
||||
System.exit(1);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user