Ejemplo n.º 1
0
  public void updateGeometry(double[] state_vector) {
    PositionInterface[] sortedHoles = Instrument.sortList(instrument.getHole());

    for (int i = 0; i < sortedHoles.length; ++i) {
      Hole hole = (Hole) sortedHoles[i];
      hole.setRatio(state_vector[i]);
    }

    instrument.updateComponents();
  }
Ejemplo n.º 2
0
  /** StateVector has an element for each hole size ratio (hole/bore) */
  public double[] getStateVector() {
    PositionInterface[] sortedHoles = Instrument.sortList(instrument.getHole());

    int len = sortedHoles.length;
    double[] state_vector = new double[len];

    for (int i = 0; i < len; ++i) {
      Hole hole = (Hole) sortedHoles[i];
      state_vector[i] = hole.getRatio();
    }

    return state_vector;
  }