I have heard good things about Parameters.jl <https://github.com/mauro3/Parameters.jl>, which lets you make types representing individual models or scenarios that have default values. You would want to do something like
using Parameters @with_kw immutable Scenario par1::Float64 = some_default_number par2::Float64 = other_default_number end default_scenario = Scenario() scenario1 = Scenario(par1=changed) scenario2 = Scenario(par2=changed) Actually, the more I look at this package the nicer it looks! In particular, the @unpack macros <http://parametersjl.readthedocs.io/en/latest/manual/#unpack-macros> look really handy. On Friday, 29 April 2016 13:56:27 UTC+1, K leo wrote: > > Thanks. My issue of using a type is where to keep the set of constant > values for each scenario. I can only put 1 set of them in the constructor. > > > On Friday, April 29, 2016 at 7:12:02 AM UTC+5:30, Lyndon White wrote: >> >> Define a type (possibly immutable) per sensation, with the constants >> Create a function that operates on that type that carries out the >> scenario. >> >> loop (or map (or pmap)) through an array of the aforementioned type, >> applying the aforementioned function. >> >> >> On Friday, 29 April 2016 09:15:40 UTC+8, K leo wrote: >>> >>> Each scenario has the same set of constants but with different values. >>> I would like to loop through all these scenarios. What are the best ways >>> to handle this? >> >>
