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

christos #24

Closed
christos89 opened this issue Jan 28, 2014 · 1 comment
Closed

christos #24

christos89 opened this issue Jan 28, 2014 · 1 comment

Comments

@christos89
Copy link

How can an Eve agent add data to its State rather than replacing it? If I have two instances of the same agent how can I retrieve both inputs and store them to its State?

I have an Eve agent that add users input in an ArryaList. However, I was getting only the last input and not the entire ArrayList of the previous inputs. Now when I run the method through the Eve interface, I get the following message
"message": "Couldn't instantiate agent for id 'result_Eve1'
What can I do?

Thank you in advance,
Kind regards,
Christos

@ludost
Copy link
Member

ludost commented Jan 28, 2014

Hi Christos,

As described on: http://eve.almende.com/implementations/java/services.html#StateService the state acts like a Map<String,Object>. (http://docs.oracle.com/javase/7/docs/api/java/util/Map.html)
This means that you put() data to a specific key. As long as the key is unique, the value will be stored separately from other values. If you put() data to the same key, the new value will overwrite the existing value.

I don't understand your second question. Maybe you can show some code highlighting the issue? The last part states that you try to contact an agent called "result_Eve1", which doesn't exist.

@ludost ludost closed this as completed Feb 5, 2014
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