I have 5 agents - bus, transformer , generator, load , line. I have a requirement where i need dynamically connect the above agents.
I have written the following code, where i am trying to connect for example bus [2] and generator[5]. The connections are not random but based on a circuit, which i am dynamically reading through a text file.
for (int l = 0; l < busList.size(); l++) {
for (int k = 0; k < generatorList.size(); k++) {
if (generatorList.get(k).getBusNumber()==busList.get(l).getBusNumber()) {
busList.get(l).getBusID().connectTo(generatorList.get(k).getGenID());
}
}
}
Can someone help with the connection part. I cannot have a generic list because I need the agent attributes for other functionalities as well.