Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setValue does not work for Variable Primitive #7

Open
herzogrh opened this issue Nov 28, 2024 · 2 comments
Open

setValue does not work for Variable Primitive #7

herzogrh opened this issue Nov 28, 2024 · 2 comments

Comments

@herzogrh
Copy link

Currently, it does not seem possible to set Values for Agent Variables programmatically as detailed here. It seems to work well for eg. Stocks inside the Agent, but for Variables the following error occurs ([Height] being a variable primitive):

grafik

After looking into the code, it seems that there is no specific setValue function specified for variable primitives. Because of that, the default error is thrown.

@scottfr
Copy link
Owner

scottfr commented Nov 30, 2024

Hi Rico,

setValue() only works with primitives that are stateful, which are the Stock and State primitives. You could trying using a Stock instead of a Variable for your Height.

@herzogrh
Copy link
Author

herzogrh commented Dec 2, 2024

Hi Scott, thanks for the quick reply! Both work, but in case I want to let's say store a piece of text in an agent's attribute, calling setValue on a Stock primitive with a String (which works just fine) seems a little counterintuitive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants