@Override
  public ParameterValue<?> get(int pos) {
    if (pos < state.size) {
      final double value = state.min + pos * state.step;
      ParameterValue<?> result = null;

      switch (parameterType) {
        case Integer:
          result =
              ParameterValueFactory.createParameterValue(
                  dynamicValueAssignment.getParameter(), (int) Math.round(value));
          break;
        case Double:
          result =
              ParameterValueFactory.createParameterValue(
                  dynamicValueAssignment.getParameter(), value);
        default:
          break;
      }

      return result;
    } else {
      throw new IndexOutOfBoundsException(
          "Parameter value index " + pos + " is out of bound [0.." + state.size + "].");
    }
  }
 @Override
 public ParameterDefinition getParameter() {
   return dynamicValueAssignment.getParameter();
 }