docs: public double getWeight(int from, int to) {
          if (hasErrors()) {
              throw new IllegalStateException("Cannot return weight (" + from + "," + to + ") if errors occured " + getErrors());
          }
  
          if (from >= weights.length) {
              throw new IllegalStateException("Cannot get 'from' " + from + " from weights with size " + weights.length);
          } else if (to >= weights[from].length) {
              throw new IllegalStateException("Cannot get 'to' " + to + " from weights with size " + weights[from].length);
          }
          return weights[from][to];
      }