* the representation at engine level
*/
public void initialize() {
QueueNetwork net = dispatcher.getSimulation().getNetwork();
NodeList nodeList = net.getNodes();
JobClassList classList = net.getJobClasses();
TreeMap<String, Object> tm = new TreeMap<String, Object>();
//a TreeMap is used to speedup the following code
for (int j = 0; j < servers.size(); j++) {
Object thisKey = servers.get(j);
String thisName = mediator.getStationDefinition().getStationName(thisKey);
tm.put(thisName, thisKey);
}
//performs the server mapping
for (int i = 0; i < nodeList.size(); i++) {
NetNode temp = nodeList.get(i);
NodeSection serviceSection = null;
try {
serviceSection = temp.getSection(NodeSection.SERVICE);
} catch (NetException ne) {
}
if (serviceSection instanceof Server || serviceSection instanceof PSServer) {
serverMap.put(tm.get(temp.getName()), temp);
}
}
tm.clear();
//performs the class mapping
for (int j = 0; j < classes.size(); j++) {
Object thisKey = classes.get(j);
String thisName = mediator.getClassDefinition().getClassName(thisKey);
tm.put(thisName, thisKey);
}
for (int i = 0; i < classList.size(); i++) {
JobClass temp = classList.get(i);
classMap.put(tm.get(temp.getName()), temp);
}
//set the initialized state
initialized = true;
}