Reputation: 3930
I have an agent that has a variable that I need to set as a constant
When adding this population to main all agents get generated without any issue.
But when adding a source block to create this agent and use it in a flow chart...
I get this error
It appears that the agents get created without access to the utils class...
How to have a constant variable that uses randomness in an agent created in a process flow block?
Upvotes: 1
Views: 102
Reputation: 12793
Quick workaround: Just use a parameter instead. In its "on change" code, you can error()
the model so it is never accidentally changed.
Now you have the same setup: a constant random value, unique for each agent instance but never changeable...
Upvotes: 1