You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following the new 6.0.0 macro for defining agents, I'd like to be able to add agents with default values for all additional attributes. However, I get a no matching method error unless I supply at least one keyword argument for additional attributes, or positional arguments for all. If I supply one karg, defaults are applied for other attributes.
Is this expected behavior?
Minimum working example mostly copied and pasted from source comments:
using Agents
using Graphs
@agent struct Agent(GraphAgent)
w::Float64 = 0.1
k::Bool = false
end
model = StandardABM(Agent, GraphSpace(complete_digraph(5)))
add_agent!(model; w = 0.5, k = true)
add_agent!(model; w = 0.5)
add_agent!(model; k = true)
add_agent!(model)
See my results:
The text was updated successfully, but these errors were encountered:
Following the new 6.0.0 macro for defining agents, I'd like to be able to add agents with default values for all additional attributes. However, I get a
no matching method
error unless I supply at least one keyword argument for additional attributes, or positional arguments for all. If I supply one karg, defaults are applied for other attributes.Is this expected behavior?
Minimum working example mostly copied and pasted from source comments:
See my results:
The text was updated successfully, but these errors were encountered: