API references
DataFrames.DataFrame — MethodDataFrame(s::Simulation;
vars=observables(s), parameters_output::Vector{Symbol}=Symbol[], iter::Union{Int,Nothing}=nothing)Converts simulation results of type SimResult, MCResult, etc to DataFrame.
Example: DataFrame(s)
Arguments:
HetaSimulator.FitResult — Typestruct FitResult{L<:Real, I}
obj::L
optim::Vector{Pair{Symbol,Float64}}
status::Symbol
numevals::I
endResult of fit.
Use optim method to get optimal values.
Use object method to get optimal objective function.
Use status to get status.
The optimal parameters can be saved in heta file, see save_as_heta method.
HetaSimulator.MCResult — Typestruct MCResult{S,C} <: AbstractResult
sim::S
saveat::Bool
scenario::C
endStructure storing results of [mc]{@ref} method applied for one Scenario.
To convert into tabular format, use DataFrame method.
The base visulaization can be done with plot method.
HetaSimulator.Model — Typestruct Model{IF,OF,EV,SG,EA, MM} <: AbstractModel
init_func::IF
ode_func::OF
events::EV
saving_generator::SG
records_output::AbstractVector{Pair{Symbol,Bool}}
constants::NamedTuple
statics::NamedTuple
events_active::EA
mass_matrix::MM
endStructure storing core properties of ODE model. This represent the content of one namespace from a Heta platform.
To get list of model content use methods: constants(model), records(model), switchers(model).
To get the default model options use methods: events_active(model), events_save(model), observables(model). These values can be rewritten by a [Scenario]{@ref}.
HetaSimulator.Platform — Typestruct Platform{M,C}
models::Dict{Symbol,M} # dictionary storing Models
scenarios::Dict{Symbol,C} # dictionary storing Scenarios
endThe main storage representing a modeling platform. Typically HetaSimulator works with one platform object which can include several models and scenarios.
Usually a Platform is created based on Heta formatted files using [load_platform]{@ref}.
To get the platform content use methods: models(platform), `scenarios(platform).
HetaSimulator.Scenario — Typestruct Scenario{F,P,M} <: AbstractScenario init_func::F prob::P measurements::M tags::AbstractVector{Symbol} group::Union{Symbol,Nothing} parameters::NamedTuple end
Type representing simulation conditions, i.e. model variant with updated parameters and outputs.
To get the internal properties use methods: tspan(scenario), parameters(scenario), measurements(scenario)
HetaSimulator.Scenario — MethodScenario(
model::Model,
tspan;
measurements::Vector{AbstractMeasurementPoint}=AbstractMeasurementPoint[],
observables::Union{Nothing,Vector{Symbol}}=nothing,
parameters::AbstractVector{<:Pair{Symbol,<:Real}} = Pair{Symbol,Float64}[],
events_active::Union{Nothing, Vector{Pair{Symbol,Bool}}} = Pair{Symbol,Bool}[],
events_save::Union{Tuple,Vector{Pair{Symbol, Tuple{Bool, Bool}}}} = (true,true),
saveat::Union{Nothing,AbstractVector} = nothing,
save_scope::Bool = true,
)Builds simulation scenario of type Scenario
Example: Scenario(model, (0., 200.))
Arguments:
model: model of typeModeltspan: time span for the ODE problemmeasurements:Vectorof measurements. Default is emptyVector{AbstractMeasurementPoint}observables: names of output observables. Overwrites default model's values. Default isnothingtags:group:parameters:VectorofPairs containing parameters' names and values. Overwrites default model's values. Default is empty vector.events_active:VectorofPairs containing events' names and true/false values. Overwrites default model's values. Default is emptyVector{Pair}events_save:TupleorVector{Tuple}marking whether to save solution before and after event. Default is(true,true)for all eventssaveat: time points, where solution should be saved. Defaultnothingvalues stands for saving solution at timepoints reached by the solversave_scope: should scope be saved together with solution. Default istrue
HetaSimulator.SimResult — Typestruct SimResult{S, C<:Scenario} <: AbstractResult
sim::S
scenario::C
endStructure storing results from [sim]{@ref} method applied for one [Scenario]{@ref}.
To get the content use methods: status(results), times(results), vals(results), parameters(results), observables(results).
The results can be transformed using DataFrame method or visualized using plot method.
HetaSimulator.add_measurements! — Methodadd_measurements!(
platform::Platform,
df::DataFrame;
kwargs...
)Adds measurements to Scenario
Arguments:
platform: platform ofPlatformtypedf:DataFramewith measurements, typically obtained withread_measurementsfunctionsubset: subset of measurements which will be added to theScenario. DefaultPair{Symbol, Symbol}[]adds all measurements from thedf
HetaSimulator.add_measurements! — Methodadd_measurements!(
scenario::Scenario,
df::DataFrame;
kwargs...
)Adds measurements to Scenario
Arguments:
scenario: simulation scenario of typeScenariodf:DataFramewith measurements, typically obtained withread_measurementsfunctionsubset: subset of measurements which will be added to theScenario. DefaultPair{Symbol, Symbol}[]adds all measurements from thedf
HetaSimulator.add_scenarios! — Methodadd_scenarios!(
platform::Platform,
df::DataFrame;
subset::AbstractVector{P} = Pair{Symbol, Symbol}[]
) where P <: Pair{Symbol, Symbol}Adds a new Scenario to the Platform
Arguments:
platform: platform ofPlatformtypedf:DataFramewith scenarios setup, typically obtained withread_scenariosfunctionsubset: subset of scenarios which will be added to theplatform. DefaultPair{Symbol, Symbol}[]adds all scenarios from thedf
HetaSimulator.estimator — Methodfunction estimator(
platform::Platform,
parameters_fitted;
scenarios::Union{AbstractVector{Symbol}, Nothing} = nothing, # all if nothing
kwargs...
)Generates likelihood estimator function for parameter identification and analysis. It is the interface for Platform. See more detailes in base estimator method.
Arguments:
platform: platform ofPlatformtypeparameters_fitted: optimization parameters and their initial valuesscenarios: vector of scenarios identifiers of typeSymbol. Default isnothingkwargs...: other arguments supported byestimator, see base method.
HetaSimulator.estimator — Methodfunction estimator(
scenario_pairs::AbstractVector{Pair{Symbol, C}},
parameters_fitted::DataFrame;
kwargs...
) where C<:AbstractScenarioGenerates likelihood estimator function for parameter identification and analysis. It is the interface for parameters from DataFrame. See more detailes in base estimator method.
Arguments:
scenario_pairs: vector of pairs containing names and scenarios of typeScenarioparameters_fitted: DataFrame with optimization parameters setup and their initial values, seeread_parameterskwargs...: other arguments supported byestimator, see base method.
HetaSimulator.estimator — Methodfunction estimator(
scenarios::AbstractVector{C},
parameters_fitted;
kwargs...
) where {C<:AbstractScenario}Generates likelihood estimator function for parameter identification and analysis. It is the interface for scenarios in vector. See more detailes in base estimator method.
Arguments:
scenarios: vector of scenarios of typeScenarioparameters_fitted: optimization parameters and their initial valueskwargs...: other arguments supported byestimator, see base method.
HetaSimulator.estimator — Methodfunction estimator(
scenario_pairs::AbstractVector{Pair{Symbol, C}},
parameters_fitted::AbstractVector{<:Pair{Symbol,<:Real}};
parameters::Union{Nothing, Vector{P}}=nothing,
alg=DEFAULT_ALG,
reltol=DEFAULT_FITTING_RELTOL,
abstol=DEFAULT_FITTING_ABSTOL,
parallel_type=EnsembleSerial(),
kwargs... # other arguments to sim
) where {C<:AbstractScenario, P<:Pair}Generates likelihood estimator function for parameter identification and analysis. It corresponds to -2ln(L) as a function depending on parameter set.
Example: estimator([:x=>scn2, :y=>scn3, :z=>scn4], [:k1=>0.1,:k2=>0.2,:k3=>0.3])
Arguments:
scenario_pairs: vector of pairs containing names and scenarios of typeScenarioparameters_fitted: parameters and their nominal values that will be used as defaultparameters: paramters, which overwrite bothModelandScenarioparameters. Default isnothingalg: ODE solver. See SciML docs for details. Default is AutoTsit5(Rosenbrock23())reltol: relative tolerance. Default is 1e-6abstol: relative tolerance. Default is 1e-8parallel_type: parallel setup. See SciML docs for details. Default is no parallelism: EnsembleSerial()kwargs...: other ODE solver related arguments supported bySciMLBase.solve. See SciML docs for details
Returns:
function(x=last.(parameters_fitted))The method returns anonimous function which depends on parameters vector in the same order as in parameters_fitted. This function is ready to be passed to optimizer routine or identifiability analysis.
HetaSimulator.fit — Methodfit(
scenario_pairs::AbstractVector{Pair{Symbol, C}},
parameters_fitted::AbstractVector{<:Pair{Symbol,<:Real}};
parameters::Union{Nothing, Vector{P}}=nothing,
alg=DEFAULT_ALG,
reltol=DEFAULT_FITTING_RELTOL,
abstol=DEFAULT_FITTING_ABSTOL,
parallel_type=EnsembleSerial(),
adtype=AutoForwardDiff(),
ftol_abs = 0.0,
ftol_rel = 1e-4,
fit_alg = NLopt.LN_NELDERMEAD(),
maxiters = 10000,
maxtime = nothing,
lbounds = fill(0.0, length(parameters_fitted)),
ubounds = fill(Inf, length(parameters_fitted)),
scale = fill(:lin, length(parameters_fitted)),
progress::Symbol = :minimal,
kwargs...
) where {C<:AbstractScenario, P<:Pair}Fit parameters to experimental measurements. Returns FitResult type.
Example: fit([:x=>scn2, :y=>scn3, :z=>scn4], [:k1=>0.1,:k2=>0.2,:k3=>0.3])
Arguments:
scenario_pairs: can be aPlatform, a vector of scenarios, or a vector of pairs (Vector{Pair{Symbol,Scenario}}), matching the accepted types of theestimatorfunction.parameters_fitted: can be a vector of pairs (Vector{Pair{Symbol,<:Real}}) or aDataFramewith parameter setup, as accepted byestimator.parameters: parameters, which overwrite bothModelandScenarioparameters. Default isnothingalg: ODE solver. See SciML docs for details. Default isAutoTsit5(Rosenbrock23())reltol: relative tolerance. Default is 1e-6abstol: absolute tolerance. Default is 1e-8parallel_type: parallel setup. See SciML docs for details. Default is no parallelism: EnsembleSerial()adtype: automatic differentiation type. See SciML docs for details. Default isAutoForwardDiff()ftol_abs: absolute tolerance on objective value. SeeOptimization.jldocs for details. Default is0.0ftol_rel: relative tolerance on objective value. SeeOptimization.jldocs for details. Default is1e-4fit_alg: fitting algorithm. SeeOptimization.jldocs for details. Default isNLopt.LN_NELDERMEAD()maxiters: maximum number of objective evaluations. SeeOptimization.jldocs for details. Default is1e4maxtime: maximum optimization time (in seconds). SeeOptimization.jldocs for details. Default isnothinglbounds: lower parameters bounds. SeeOptimization.jldocs for details. Default isfill(0.0, length(parameters_fitted))ubounds: upper parameters bounds. SeeOptimization.jldocs for details. Default isfill(Inf, length(parameters_fitted))scale: scale of the parameters (supports:lin, :direct, :log, :log10) to be used during fitting. Default isfill(:lin, length(parameters_fitted)).:directvalue is a synonym of:lin.progress: progress mode display. One of three values::silent,:minimal,:full. Default is:minimalkwargs...: other solver related arguments supported by SciMLBase.solve. See SciML docs for details
HetaSimulator.generate_optimization_problem — Methodgenerate_optimization_problem(platform::Platform,
parameters_fitted;
scenarios::Union{AbstractVector{Symbol}, Nothing} = nothing,
kwargs...
) where C<:AbstractScenarioGenerates OptimizationProblem. Returns OptimizationProblem type.
Example:
generate_optimization_problem(platform, [:k1=>0.1,:k2=>0.2,:k3=>0.3];scenarios=[:scn2,:scn3])
Arguments:
platform: platform ofPlatformtypeparameters_fitted: optimization parameters and their initial valuesscenarios: vector of scenarios identifiers of typeSymbol. Default isnothingkwargs...: other ODE solver andfitrelated arguments supported bygenerate_optimization_problem(scenario_pairs::Vector{<:Pair}, parameters_fitted::Vector{<:Pair}
HetaSimulator.generate_optimization_problem — Methodgenerate_optimization_problem(
scenario_pairs::AbstractVector{Pair{Symbol, C}},
parameters_fitted::DataFrame;
kwargs...
) where C<:AbstractScenarioGenerates OptimizationProblem. Returns OptimizationProblem type.
Arguments:
scenario_pairs: vector of pairs containing names and scenarios of typeScenarioparameters_fitted: DataFrame with optimization parameters setup and their initial values, seeread_parameterskwargs...: other ODE solver andfitarguments supported bygenerate_optimization_problem(scenario_pairs::Vector{<:Pair}, parameters_fitted::Vector{<:Pair}
HetaSimulator.generate_optimization_problem — Methodgenerate_optimization_problem(
scenarios::AbstractVector{C},
parameters_fitted;
kwargs...
) where C<:AbstractScenarioGenerates OptimizationProblem. Returns OptimizationProblem type.
Example:
generate_optimization_problem([scn2, scn3, scn4], [:k1=>0.1,:k2=>0.2,:k3=>0.3])
Arguments:
scenarios: vector of scenarios of typeScenarioparameters_fitted: optimization parameters and their initial valueskwargs...: other ODE solver andfitrelated arguments supported bygenerate_optimization_problem(scenario_pairs::Vector{<:Pair}, parameters_fitted::Vector{<:Pair}
HetaSimulator.generate_optimization_problem — Methodgenerate_optimization_problem(
scenario_pairs::AbstractVector{Pair{Symbol, C}},
parameters_fitted::AbstractVector{<:Pair{Symbol,<:Real}};
parameters::Union{Nothing, Vector{P}}=nothing,
alg=DEFAULT_ALG,
reltol=DEFAULT_FITTING_RELTOL,
abstol=DEFAULT_FITTING_ABSTOL,
parallel_type=EnsembleSerial(),
adtype=AutoForwardDiff(),
lbounds = fill(0.0, length(parameters_fitted)),
ubounds = fill(Inf, length(parameters_fitted)),
scale = fill(:lin, length(parameters_fitted)),
progress::Symbol = :minimal,
kwargs...
) where {C<:AbstractScenario, P<:Pair}Generates OptimizationProblem. Returns OptimizationProblem type.
Example: generate_optimization_problem([:x=>scn2, :y=>scn3, :z=>scn4], [:k1=>0.1,:k2=>0.2,:k3=>0.3])
Arguments:
scenario_pairs: vector of pairs containing names and scenarios of typeScenarioparameters_fitted: optimization parameters and their initial valuesparameters: parameters, which overwrite bothModelandScenarioparameters. Default isnothingalg: ODE solver. See SciML docs for details. Default isAutoTsit5(Rosenbrock23())reltol: relative tolerance. Default is 1e-6abstol: absolute tolerance. Default is 1e-8parallel_type: parallel setup. See SciML docs for details. Default is no parallelism: EnsembleSerial()adtype: automatic differentiation type. See SciML docs for details. Default isAutoForwardDiff()lbounds: lower parameters bounds. SeeOptimization.jldocs for details. Default isfill(0.0, length(parameters_fitted))ubounds: upper parameters bounds. SeeOptimization.jldocs for details. Default isfill(Inf, length(parameters_fitted))scale: scale of the parameters (supports:lin, :direct, :log, :log10) to be used during fitting. Default isfill(:lin, length(parameters_fitted)).:directvalue is a synonym of:lin.progress: progress mode display. One of three values::silent,:minimal,:full. Default is:minimalkwargs...: other solver related arguments supported by SciMLBase.solve. See SciML docs for details
HetaSimulator.heta — Methodheta(;version::Bool=false, help::Bool=false)Run heta command in console.
Arguments:
version:trueif only heta-compiler version is requiredhelp:trueif CLI help wanted
HetaSimulator.heta_build — Methodheta_build(
target_dir::AbstractString;
declaration::String = "platform",
units_check::Bool = false,
log_mode::String = "error",
log_path::String = "build.log",
log_level::String = "info",
debug::Bool = false,
dist_dir::String = "dist",
meta_dir::String = "meta",
source::String = "index.heta",
type::String = "heta",
export_::Union{String, Nothing} = nothing,
)Builds the models from Heta-based platform
See heta compiler docs for details: https://hetalang.github.io/#/heta-compiler/cli-references?id=running-build-with-cli-options
Arguments:
target_dir: path to a Heta platform directorydeclaration: path to declaration file. Default is"platform"units_check: if set totrueunits will be checked for the consistancylog_mode: log mode. Default is"error"log_path: path to the log file. Default is"build.log"log_level: log level to display. Default is"info"debug: turn on debug mode. Default isfalsedist_dir: directory path, where to write distributives to. Default is"dist"meta_dir: meta directory path. Default is"meta"source: path to the main heta module. Default is"index.heta"type: type of the source file. Default is"heta"export_: export the model to the specified format:Julia,JSON,{format:SBML,version:L3V1},JSON
HetaSimulator.heta_help — Methodheta_help(command::String)Display help for heta-compiler CLI
Arguments:
command: command to display
HetaSimulator.heta_init — Methodheta_init(dir::String; force::Bool=false, silent::Bool=false)Run initialization of the platform
Argument:
dir: platform directoryforce: iftruethen replace files and directoriessilent: iftrueuse default options without prompt
HetaSimulator.heta_version — Methodheta_version()Display heta-compiler version
HetaSimulator.load_jlmodel — Methodload_jlmodel(
model_jl::AbstractString
)Loads prebuild julia model without Platform
Arguments:
model_jl: path to Julia model file
HetaSimulator.load_jlplatform — Methodload_jlplatform(
model_jl::AbstractString
)Loads prebuild julia model as part of Platform
Arguments:
model_jl: path to Julia model file
HetaSimulator.load_platform — Methodload_platform(
target_dir::AbstractString;
rm_out::Bool = true,
source::String = "index.heta",
type::String = "heta",
kwargs...
)Converts heta model to Julia and outputs Platform type.
See heta comiler docs for details: https://hetalang.github.io/#/heta-compiler/cli-references?id=running-build-with-cli-options
Arguments:
target_dir: path to a Heta platform directoryrm_out: should the file with Julia model be removed after the model is loaded. Default istrue- kwargs : other arguments supported by
heta_build
HetaSimulator.mc! — Methodmc!(mcres::M;
success_status::Vector{Symbol}=[:Success,:Terminated]
kwargs...
) where M <: Union{MCResult, Vector{MCResult}, Vector{Pair}}Re-run failed Monte-Carlo simulations with single Scenario. Updates MCResult type.
Example: mc!(mcres)
Arguments:
mcres: Monte-Carlo result of typeMCResultsuccess_status: Vector of success statuses. Default is[:Success,:Terminated]- kwargs : other solver related arguments supported by
mc(scenario::Scenario, parameters_variation::Vector, num_iter::Int64)
HetaSimulator.mc — Methodmc(scenario::Scenario,
parameters_variation::DataFrame,
num_iter::Int;
kwargs...
)Run Monte-Carlo simulations with single scenario Scenario. Returns MCResult type.
Example: mc(scn1, DataFrame(k2=rand(3),k3=rand(3)), 1000)
Arguments:
scenario: simulation scenario of typeScenarioparameters_variation: DataFrame with pre-generated parameters.num_iter: number of Monte-Carlo iterations- kwargs : other solver related arguments supported by
mc(scenario::Scenario, parameters_variation::Vector, num_iter::Int64)
HetaSimulator.mc — Methodmc(scenario_pairs::Vector{<:Pair},
parameters_variation::Vector{<:Pair},
num_iter::Int64;
verbose=false,
alg=DEFAULT_ALG,
reltol=DEFAULT_SIMULATION_RELTOL,
abstol=DEFAULT_SIMULATION_ABSTOL,
parallel_type=EnsembleSerial(),
kwargs...
)Run Monte-Carlo simulations with single Scenario. Returns Vector{MCResult} type.
Example: mc([:c1=>scn1,:c2=>scn2], [:k2=>Normal(1e-3,1e-4), :k3=>Uniform(1e-4,1e-2)], 1000)
Arguments:
scenario_pairs: vector of pairs containing names and scenarios of typeScenarioparameters_variation: parameters variation setupnum_iter: number of Monte-Carlo iterationsverbose: print iteration progress. Default isfalseprogress_bar: show progress bar. Default isfalsealg: ODE solver. See SciML docs for details. Default is AutoTsit5(Rosenbrock23())reltol: relative tolerance. Default is 1e-3abstol: relative tolerance. Default is 1e-6output_func: the function determines what is saved from the solution to the output array. Defaults to saving the solution itselfreduction_func: this function determines how to reduce the data in each batch. Defaults to appending the data from the batchesparallel_type: parallel setup. See SciML docs for details. Default is no parallelism: EnsembleSerial()- kwargs : other solver related arguments supported by SciMLBase.solve. See SciML docs for details
HetaSimulator.mc — Methodmc(scenario_pairs::Vector{<:AbstractScenario},
parameters_variation::Vector{<:Pair},
num_iter::Int64;
kwargs...
)Run Monte-Carlo simulations with single scenario. Returns Vector{MCResult} type.
Example: mc([scn1,scn2], [:k2=>Normal(1e-3,1e-4), :k3=>Uniform(1e-4,1e-2)], 1000)
Arguments:
scenario_pairs: vector of scenarios of typeScenarioparameters_variation: parameters variation setupnum_iter: number of Monte-Carlo iterations- kwargs : other solver related arguments supported by
mc(scenario_pairs::Vector{<:Pair}, parameters_variation::Vector, num_iter::Int64)
HetaSimulator.mc — Methodmc(platform::Platform,
parameters_variation::Vector{<:Pair},
num_iter::Int64;
kwargs...
)Run Monte-Carlo simulations with single Scenario. Returns Vector{MCResult} type.
Example: mc(platform, [:k2=>Normal(1e-3,1e-4), :k3=>Uniform(1e-4,1e-2)], 1000)
Arguments:
platform: platform ofPlatformtypeparameters_variation: parameters variation setupnum_iter: number of Monte-Carlo iterations- kwargs : other solver related arguments supported by
mc(scenario_pairs::Vector{<:Pair}, parameters_variation::Vector, num_iter::Int64)
HetaSimulator.mc — Methodmc(scenario::Scenario,
parameters_variation::Vector{<:Pair},
num_iter::Int;
verbose=false,
alg=DEFAULT_ALG,
reltol=DEFAULT_SIMULATION_RELTOL,
abstol=DEFAULT_SIMULATION_ABSTOL,
parallel_type=EnsembleSerial(),
kwargs...
)Run Monte-Carlo simulations with single Scenario. Returns MCResult type.
Example: mc(scenario, [:k2=>Normal(1e-3,1e-4), :k3=>Uniform(1e-4,1e-2)], 1000)
Arguments:
scenario: simulation scenario of typeScenarioparameters_variation: parameters variation setupnum_iter: number of Monte-Carlo iterationsverbose: print iteration progress. Default isfalseprogress_bar: show progress bar. Default isfalsealg: ODE solver. See SciML docs for details. Default is AutoTsit5(Rosenbrock23())reltol: relative tolerance. Default is 1e-3abstol: relative tolerance. Default is 1e-6output_func: the function determines what is saved from the solution to the output array. Defaults to saving the solution itselfreduction_func: this function determines how to reduce the data in each batch. Defaults to appending the data from the batchesparallel_type: parallel setup. See SciML docs for details. Default is no parallelism: EnsembleSerial()- kwargs : other solver related arguments supported by SciMLBase.solve. See SciML docs for details
HetaSimulator.read_mcvecs — Methodread_mcvecs(filepath::String)Read table with pre-generated parameters for Monte-Carlo simulations. Typically used for virtual patients simulations
Arguments:
filepath: path to the file with pre-generated parameters
HetaSimulator.read_measurements — Functionread_measurements(filepath::String, sheet=1; kwargs...)Reads table file with measurements to DataFrame
Arguments:
filepath: path to table file. Supports ".csv" and ".xlsx" filessheet: number of sheet in case of ".xlsx" file. Default is1- kwargs... : other arguments supported by
CSV.FileorXLSX.readtable
HetaSimulator.read_parameters — Methodread_parameters(filepath::String; kwargs...)
Reads parameters csv file and output DataFrame
Arguments:
filepath: path to valid parameters csv file
HetaSimulator.read_scenarios — Functionread_scenarios(filepath::String, sheet=1; kwargs...)Reads table file with scenarios to DataFrame
Arguments:
filepath: path to table file. Supports ".csv" and ".xlsx" filessheet: number of sheet in case of ".xlsx" file. Default is1- kwargs : other arguments supported by
CSV.FileorXLSX.readtable
HetaSimulator.save_as_heta — Methodsaveasheta(filepath::String, fr::FitResult)
Save fitting results in the Heta-formatted file.
Arguments
filepath: file to save. The ".heta" extension is usually used.fr: fitting results.
HetaSimulator.save_results — Methodsave_results(filepath::String, sim::AbstractResult)Save results as csv file
Arguments:
filepath: path and name of the file to write tosim: simulation results ofAbstractResulttype
HetaSimulator.sim — Methodsim(platform::Platform;
scenarios::Union{AbstractVector{Symbol}, AbstractVector{InvertedIndex{Symbol}}, Nothing} = nothing,
kwargs...) where {C<:AbstractScenario}Simulate scenarios included in platform. Returns Vector{Pair}.
Example: sim(platform)
Arguments:
platform: platform ofPlatformtypescenarios:Vectorcontaining names of scenarios included in platform. Default valuenothingstands for all scenarios in the platformkwargs...: other kwargs supported bysim(scenario_pairs::Vector{Pair})
HetaSimulator.sim — Methodsim(scenario::Scenario;
parameters::AbstractVector{<:Pair{Symbol,<:Real}}=Pair{Symbol, Float64}[],
alg=DEFAULT_ALG,
reltol=DEFAULT_SIMULATION_RELTOL,
abstol=DEFAULT_SIMULATION_ABSTOL,
kwargs...)Simulate single Scenario. Returns SimResult type.
Example: Scenario(model, (0., 200.); saveat = [0.0, 150.]) |> sim
Arguments:
scenario: simulation scenario of typeScenarioparameters: parameters overwrite bothModelandScenarioparameters. Default is empty vector.alg: ODE solver. See SciML docs for details. Default is AutoTsit5(Rosenbrock23())reltol: relative tolerance. Default is 1e-3abstol: relative tolerance. Default is 1e-6kwargs...: other solver related arguments supported by SciMLBase.solve. See SciML docs for details
HetaSimulator.sim — Methodsim(scenarios::AbstractVector{C}; kwargs...) where {C<:AbstractScenario}Simulate multiple scenarios. Returns Vector{Pair}.
Example: sim([scn1, scn2, scn3])
Arguments:
scenarios:Vectorcontaining names and scenarios of typeScenario- kwargs : other kwargs supported by
sim(scenario_pairs::Vector{Pair})
HetaSimulator.sim — Methodsim(scenario_pairs::Vector{P};
parameters::AbstractVector{<:Pair{Symbol, <:Real}}=Pair{Symbol, Float64}[],
alg=DEFAULT_ALG,
reltol=DEFAULT_SIMULATION_RELTOL,
abstol=DEFAULT_SIMULATION_ABSTOL,
parallel_type=EnsembleSerial(),
kwargs...) where P<:PairSimulate multiple scenarios. Returns Vector{Pair}.
Example: sim([:x => scn1, :y=>scn2, :z=>scn3])
Arguments:
scenario_pairs: vector of pairs containing names and scenarios of typeScenarioparameters: parameters, which overwrite bothModelandScenarioparameters. Default is empty vector.alg: ODE solver. See SciML docs for details. Default is AutoTsit5(Rosenbrock23())reltol: relative tolerance. Default is 1e-3abstol: absolute tolerance. Default is 1e-6output_func: the function determines what is saved from the solution to the output array. Defaults to saving the solution itselfreduction_func: this function determines how to reduce the data in each batch. Defaults to appending the data from the batchesparallel_type: parallel setup. See SciML docs for details. Default is no parallelism: EnsembleSerial()kwargs...: other solver related arguments supported by SciMLBase.solve. See SciML docs for de #updateinitvalues(scni.prob, scni.initfunc, parametersnt) tails