Training neural networks with extension R in NetLogo
I am creating a supply chain simulation with NetLogo. I am putting a list of lists from NetLogo to R, which is represented by distributor ID (agents who) and sales history (sales of all previous ticks). In R I train my neural network and make predictions. When I put back the answer in the same format list of lists. I need to specify which result goes to which agent. However, I do not know how to do it in NetLogo. I assume that there should be a function to do that, but as I understand the functions are programmed with Java and I would need to assign the values inside the raw code and not in the NetLogo environment. Moreover, I think that this training and predictions occurs multiple times (for each agent) and not only once.
[  [ 100 200 300 100 200] ]
[  [ 200 300 100 100 200] ]
Where the first index is agents who index and the second is the agent's sales history.
Maybe someone could explain how NetLogo and R can be combined for computational purpose and not only statistical analysis and plotting? I assume that NetLogo is similar to parallel programming, while my style of R programming is more linear.