I am trying to model peer influence for churn situations. Agents will send messages to their peers depending on different conditions. I have also created a List called MessagesReceived to store received messages.(The number of these messages may be >1).
Inside the Agent's Connections>Communications>OnMessageReceived , I have added this.Messages_Recieved.add(msg);
which should add the received message to the list.
Now I get a NullPointerException Error on onReceive method of my agent.
first, you have a collections object in the agents palette that you can use instead of this, you can check the collection class options to select LinkedList
but if you insist in using a variable to define the list, you need to initialize it like this::