The short answer is that you need to include
each file exactly once. Including a file multiple times (once via ammend_props.jl
and again via main.jl
) creates completely different types and functions that happen to have the same names, which is never what you want. I posted a few relevant answers back on this older thread that might be helpful: Modules and namespaces - #5 by rdeits
In your case, you could delete include("agent_type.jl")
from Ammend_Props
and instead just do using ..AgentType: Causality
(note the ..
instead of .
since you’d be referring to the AgentType
module in the parent Main
.