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