Hello,
I would like to improve the performance of my code. And now starting to make stable types. Is it possible to create types with a concrete dimension in a struct with other fields of the struct? I know that this is not working, but I hope, that it is clear what I would like to do. And does it have a big effect to specify the concrete dimension of the variables instead of just specify the type?
#Code of the struct
mutable struct Ind
num_parm_types::Int64
num_obj_func::Int64
obj_func_goal::Array{String,1}(num_obj_func,1)
obj_func_names::Array{String,1}(num_obj_func,1)
obj_func_goal_val::Array{Float64,2}(num_obj_func, 1)
par_names::Array{String,1}(num_parm_types, 1)
sorting_method::Array{String,1}(num_parm_types, 1)
dist_method::Array{String,1}(num_parm_types, 1)
parms_lim ::Array{Array{Float64(2, 1),1},1}(num_parm_types, 1)
par_size::Array{Int64,1}(num_parm_types, 1)
min_gap::Array{Float64,1}(num_parm_types, 1)
parms ::Array{Array{Float64,2}(undef, 1),1}(num_parm_types, 1)
obj_func::DataFrame
end
# Code of the initialization of an instance of the struct Ind
num_parm_types = 2
num_obj_func = 2
obj_func_names = ["f1", "f2"]
par_names = ["x1", "x2"]
sorting_method = ["None", "None"]
dist_method = ["Random", "Random"]
obj_func_goal = ["Minimum", "Minimum"]
min_gap = [0.0,0.0]
par_size = [1, 1]
parms_lim = [[-5, 10], [-5.0, 10.0]]
ind = Individual.Ind(obj_func_goal, num_parm_types, num_obj_func, obj_func_names, par_names, sorting_method, dist_method,
parms_lim, par_size, min_gap)