protected void setValidationDataSet(DataSetAggregated validationDataSet) {
   this.validationDataSet = validationDataSet;
   this.size = validationDataSet.size();
   this.validationRows =
       DataSetToValidationRows.convert(
           this.validationDataSet,
           this.nameOfDependentParameter,
           this.namesOfIndependentParameters);
 }
  @Override
  public void getResults() {
    // getUser().getCurrentPersistenceProvider().loadAllScenarioInstances().get(0).getExperimentSeriesList().get(0).getLatestExperimentSeriesRun().getSuccessfulResultDataSet().

    try {
      List<ScenarioInstance> instances =
          getUser().getCurrentPersistenceProvider().loadAllScenarioInstances();

      System.out.println("");

      DataSetAggregated d = new DataSetAggregated();

      SimpleDataSet sd = d.convertToSimpleDataSet();

      DataSetCsvHandler handler = new DataSetCsvHandler(';', '#', true);
      // handler.store(dataset, fileName)
      // handler.
    } catch (DataNotFoundException e) {
      throw new RuntimeException(e);
    }
  }
 /**
  * @param validationDataSet the measured data against which prediction functions should be
  *     validated
  * @param nameOfDependentParameter the name of the dependent parameter in the dataset
  * @param namesOfIndependentParameters the names of the independent parameters in the dataset
  */
 public ValidationObject(
     DataSetAggregated validationDataSet,
     String nameOfDependentParameter,
     List<String> namesOfIndependentParameters) {
   super();
   this.validationDataSet = validationDataSet;
   this.size = validationDataSet.size();
   this.nameOfDependentParameter = nameOfDependentParameter;
   this.namesOfIndependentParameters = namesOfIndependentParameters;
   this.validationRows =
       DataSetToValidationRows.convert(
           this.validationDataSet,
           this.nameOfDependentParameter,
           this.namesOfIndependentParameters);
 }
  @Override
  public String getResultAsR(String scenario, String exoerimentSeries, String url, long timestamp) {
    try {
      ScenarioInstance instance = getScenarioInstance(getSessionId(), scenario, url);
      ExperimentSeries series = getSeries(instance, exoerimentSeries);
      ExperimentSeriesRun run = getRun(series, timestamp);

      DataSetAggregated dataset = run.getSuccessfulResultDataSet();
      SimpleDataSet simpleDataset = dataset.convertToSimpleDataSet();

      StringBuffer rValue = new StringBuffer();

      int i = 0;
      // for (SimpleDataSetRow row : simpleDataset.getRowList()) {
      for (Iterator<SimpleDataSetRow> rowIter = simpleDataset.getRowList().iterator();
          rowIter.hasNext();
          i++) {
        rValue.append("r");
        rValue.append(i);
        rValue.append(" <- c(");

        for (Iterator<ParameterValue> colIter = rowIter.next().getRowValues().iterator();
            colIter.hasNext(); ) {
          Object val = colIter.next().getValue();
          if (val instanceof String) {
            rValue.append("\"");
            rValue.append(val.toString());
            rValue.append("\"");
          } else {
            rValue.append(val.toString());
          }
          if (colIter.hasNext()) {
            rValue.append(", ");
          }
        }

        rValue.append(")\n");
      }

      rValue.append("myframe <- data.frame(");
      for (int n = 0; n < i; n++) {
        rValue.append("r");
        rValue.append(n);
        if (n + 1 < i) {
          rValue.append(", ");
        }
      }
      rValue.append(")\ncolnames(myframe) <- c(");

      for (Iterator<SimpleDataSetColumn> iter = simpleDataset.getColumns().iterator();
          iter.hasNext(); ) {
        rValue.append("\"");
        rValue.append(iter.next().getParameter().getName());
        rValue.append("\"");
        if (iter.hasNext()) {
          rValue.append(", ");
        }
      }
      rValue.append(")");

      return rValue.toString();
    } catch (DataNotFoundException e) {
      return "No Data Found";
    }
  }