def METHOD_NAME(self):
    if not self._dim_size or not self.local_ports:
        print("topoHyperX: calling getNumNodes before shape, width and local_ports were set.")
        exit(1)
    num_routers = 1;
    for x in self._dim_size:
        num_routers = num_routers * x
    return num_routers * int(self.local_ports)