I’m using the Parameters package that uses a macro to define parameters. I wonder if there is any way to iterate by changing the struct information. An example:
using Parameters
@with_kw struct params
path::String = files_even[1]
model::String = "dcmst"
EPS::Float64 = 0.0001
test::Bool = 1
plot::Bool = 1
end
g_params = params()
Here I have an array that has all the paths to instances that I want to test. I would like to iterate through the files_even array by changing the value of the path parameter.
When I implement a for to iterate, it issues the following error:
for i in 1:10
@with_kw struct params
path::String = files_even[i]
model::String = "dcmst"
EPS::Float64 = 0.0001
test::Bool = 1
plot::Bool = 1
end
end
And the error:
ERROR: syntax: macro definition not allowed inside a local scope
Thanks in advance!