Simulation
During the simulation of a model, a Simulation object is constructed. The field names of the Simulation object is
model::Model: The model for which theSimulationis constructed.path::String: The path of the directory into which all simulation-related files (log, data files etc.) are saved.logger::AbstractLogger: The logger of the simulation constructed to log each stage of theSimulation.state::Symbol: The state of theSimulation. Thestatemay be:runningif the simulation is running,:haltedis the simulation is terminated without being completed,:doneif it is terminated.retcode::Symbol: The return code of the simulation. Theretcodemay be:successif the simulation is completed without errors,:failedif the an error occurs during the simulation.
Full API
Jusdl.Models.setlogger — Functionsetlogger(path, name; setglobal::Bool=true)Returns a logger. path is the path and name is the name of the file of the logger. If setglobal is true, the returned logger is a global logger.
Example
julia> logger = setlogger(tempdir(), "mylogger", setglobal=true)
Base.CoreLogging.SimpleLogger(IOStream(<file /tmp/mylogger>), Info, Dict{Any,Int64}())Jusdl.Models.closelogger — Functioncloselogger(logger=global_logger())Closes the logger the file of the loggger. See also: setlogger
Jusdl.Models.report — Functionreport(simulation::Simulation)Records the state of the simulation by writing all its fields into a data file. All the fields of the simulation is written into file. When the file is read back, the simulation object is constructed back. The data file is written under the path of the simulation.
Jusdl.Models.SimulationError — TypeSimulationError(msg::String)Thrown when an error occurs during a simulation.