worlddynamics / Vensim2MTK.jl

A Julia package to import Vensim .xmile files as ModelingToolkit.jl models.
MIT License
2 stars 1 forks source link

BoundsError when running model_translation.jl with filepath="exemples/lokta.xmile" #3

Closed natema closed 1 year ago

natema commented 1 year ago

I just tried to change line 7 to "exemples/lokta.xmile" but when I run model_translation.jl I get

ERROR: BoundsError: attempt to access 0-element Vector{RegexMatch} at index [1]
Stacktrace:
 [1] getindex
   @ ./essentials.jl:13 [inlined]
 [2] table_maker(eqn_ind::Int64, tables_ind::Int64, root::Node)
   @ Main ~/Repositories/Vensimxml-to-julia-parser/model_translation.jl:702
 [3] top-level scope
   @ ~/Repositories/Vensimxml-to-julia-parser/model_translation.jl:709
meyde commented 1 year ago

this was because i used the wrong lokta.xmile file, sorry. i corrected the issue, which was the placeholder table i used here to separate the parameters was not right. I also realized that the tables can only contain Float values to be accepted, i think i need to change that.

natema commented 1 year ago

Good, it works.