Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions docs/src/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,10 @@ match_id("10-330")
area_needed(100_000, 6.8)

# Create a convenient result store to help extract data from RME
result_store = ResultStore(start_year, end_year, reps)

# Collect results for runs 1, 3 and 5 only
collect_rep_results!(result_store, start_year, end_year, [1,3,5])
result_store = ResultStore(start_year, end_year)

# Collect and store all results, where `reps` is the total number of expected runs.
collect_all_results!(result_store, start_year, end_year, reps)
concat_results!(result_store, start_year, end_year, reps)

# Initialize RME runs
run_init()
Expand Down Expand Up @@ -156,7 +153,7 @@ target_reef_areas_km² = reef_areas(target_reef_ids)
d_density_m² = 6.8

# Initialize result store
result_store = ResultStore(start_year, end_year, reps)
result_store = ResultStore(start_year, end_year)
# Outputs:
# ReefModEngine Result Store
#
Expand Down Expand Up @@ -206,7 +203,7 @@ run_init()
@time @RME runProcess()::Cint

# Collect and store results
collect_all_results!(result_store, start_year, end_year, reps)
concat_results!(result_store, start_year, end_year, reps)

# Save results to matfile with entries (matching ReefMod Engine standard names)
# Defaults to "RME_outcomes_[today's date].mat"
Expand Down Expand Up @@ -263,7 +260,7 @@ reps = 4 # Number of repeats: number of random environmental seque
n_reefs = length(reef_id_list)

# Initialize result store
result_store = ResultStore(start_year, end_year, reps)
result_store = ResultStore(start_year, end_year)

set_option("use_fixed_seed", 1) # Turn on use of a fixed seed value
set_option("fixed_seed", 123.0) # Set the fixed seed value
Expand Down Expand Up @@ -291,6 +288,6 @@ for r in 1:reps
@time @RME runProcess()::Cint

# Collect results for this specific replicate
collect_rep_results!(result_store, start_year, end_year, [r])
concat_results!(result_store, start_year, end_year, 1)
end
```
33 changes: 0 additions & 33 deletions ext/MatExt.jl

This file was deleted.

17 changes: 15 additions & 2 deletions src/ReefModEngine.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ macro RME(func)
end
end

"""
Only for use when RME functions return non-error numeric results.

# Examples

```julia
count_per_m2::Float64 = @getRME ivOutplantCountPerM2("iv_name"::Cstring)::Cdouble
```
"""
macro getRME(func)
return esc(Meta.parse("@ccall RME.$(func)"))
end

include("rme_init.jl")
include("interface.jl")
include("deployment.jl")
Expand All @@ -35,7 +48,7 @@ end

# Set up and initialization
export
init_rme, reset_rme, @RME, set_option, run_init
init_rme, reset_rme, @RME, @getRME, set_option, run_init

# Convenience/utility methods
export
Expand All @@ -44,6 +57,6 @@ export

# IO
export
ResultStore, collect_all_results!, collect_rep_results!, save_to_mat
ResultStore, concat_results!, save_to_mat

end
Loading