Skip to content

Finalization and Data Logging

Clayton Johnson edited this page Jul 17, 2018 · 5 revisions

This section is dedicated to describing how the simulator wraps everything up and outputs all the information desired to the console and output files.

  • The end of the simulation is an event scheduled at the beginning of the simulator in the following line:
   schedule(getId(), SimSettings.getInstance().getSimulationTime(), STOP_SIMULATION);

which schedules the STOP_SIMULATION event once the total time assigned for the simulator has elapsed. This triggers CloudSim.terminateSimulation(); and later SimLogger.getInstance().simStopped();

SimLogger

SimLogger is the most important class in this section.

What happens in SimLogger Before the End

      When a task/application running on the network ends, it sends its status to SimLogger as COMPLETED or some failure reason. SimLogger then logs this information and sorts it all out based on the type of application. This was intended so one would be able to test how different applications ran on this network. This functionality still exists and should be used to analyze how the networks built may react under certain stresses.
      The large point here is that information is stored in SimLogger whenever a task/application is done executing on the network. This makes outputting large amounts of data easier since it is all stored within the class.

Termination is Triggered

      Once SimLogger is informed of the end of the simulation, it wraps everything up and outputs it. Okay, that's extremely simplified but that is all it does. The output files are completed and the console is updated. If there are specific metrics that one wishes to output from the simulations, just make it so they may be accessed from SimLogger because it will be 100% easier. There are files produced for MatLab as well, which are stored in the scripts matlab folder. Some changes would have to be made to the matlab files so that it works on your system, however they should be as easy as changing the file paths or adding additional graphs.