private Probeable getNeuron(String nodeName, int index)
throws SimulationException {
Node ensemble = myNodeMap.get(nodeName);
if (ensemble == null) {
throw new SimulationException("The named Ensemble does not exist");
}
if (!(ensemble instanceof Ensemble)) {
throw new SimulationException("The named Node is not an Ensemble");
}
Node[] nodes = ((Ensemble) ensemble).getNodes();
if (index < 0 || index >= nodes.length) {
throw new SimulationException("The Node index " + index
+ " is out of range for Ensemble size " + nodes.length);
}
if (!(nodes[index] instanceof Probeable)) {
throw new SimulationException("The specified Node is not Probeable");
}
return (Probeable) nodes[index];
}