0

I'm working on a project using CloudSim simulation tool for masters. I want to know how to save the output of the printCloudletList to a csv file in NetBeans. Any ideas? Please let me know.

Dalia
  • 1

2 Answers2

0

Using CloudSim Plus you can generate results in CSV and other formats. The code is as below. CloudSim Plus even allows you to add any data you want to the generated table.

try {
    CsvTable csv = new CsvTable();
    csv.setPrintStream(new PrintStream(new java.io.File("/tmp/results.csv")));
    new CloudletsTableBuilder(broker0.getCloudletFinishedList(), csv).build();
} catch (IOException e) {
    System.err.println(e.getMessage());
}
Manoel Campos
  • 933
  • 9
  • 12
0

The code here worked for me. Just had to do some imports after pasting in code. Needed some minimal formatting of outputted csv file to get it right in excel format.

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 13 '22 at 06:49