I have two events (movement of agent A and agent B). The agent movements are set in a certain class and realized as objects (mutable structs). I want to compute the distance between the two agents in a third event.
Currently the distance is only computed on the initial position. I guess I have to use the push!(...., newposition) command to update the positions. I see in the documentation that you are using the push! command. It is not clear to me, why. I currently get some errors.
println(typeof(x))
println(typeof(obj.state))
push!(obj.state, x)
ERROR:
LoadError: MethodError: Cannot `convert` an object of type Vector{Float64} to an object of type Float64
x and obj.state are from type Vector{Float64}. So I do not understand the error. With the push! command I want to update the current state (position) of each agent by a new value x.
Update: it seems that it does not work in different modules. take! for a channel does not produce an error, but the simulation does not continue.
I have two events (movement of agent A and agent B). The agent movements are set in a certain class and realized as objects (mutable structs). I want to compute the distance between the two agents in a third event.
Currently the distance is only computed on the initial position. I guess I have to use the push!(...., newposition) command to update the positions. I see in the documentation that you are using the push! command. It is not clear to me, why. I currently get some errors.
x and obj.state are from type Vector{Float64}. So I do not understand the error. With the push! command I want to update the current state (position) of each agent by a new value x.
Update: it seems that it does not work in different modules. take! for a channel does not produce an error, but the simulation does not continue.