I'm quite new with Java & AnyLogic so please get on my level for this one.
Is there a way for agents to get a variable value from another agent? In that case, agents would be of the same type. Thus, they all have the same variables, but since it's variables with random initial values and not parameters, the values aren't the same.
Agents are also initially connected via Small-World connections and these connections are not altered during the runs.
How can agents, occurring in a Event for example, gather a variable value from another agent (e.g. Agent i gets the variable value X of agent j). This value would be put in a small equation in order to modify the value of variable X of agent i. In other words, the agent i would be affected by his connected agent j, hence altering his value of X.
I've tried multiple combinations of .getConnectedAgent()
and .get
without any success. I'm now trying to extract the values of X for each agent into a database and then use that database to gather the value of X of agent j by agent i, but I'm not making any progress there.
The values needed to be extracted are double
s, but I could change the variables to integers if it would be easier.