@Override
  public IState createState(int size, IObservationContext context) throws ThinklabException {

    IConcept[] vmaps = new IConcept[classifiers.size()];
    for (int i = 0; i < classifiers.size(); i++) vmaps[i] = classifiers.get(i).getSecond();

    IState ret =
        new CategoricalDistributionDatasource(
            cSpace, size, vmaps, classifiers, (ObservationContext) context);

    ret.getMetadata().merge(this.metadata);

    return ret;
  }
Beispiel #2
0
  @Override
  public String persist() throws ThinklabException {

    /*
     * persist all states
     */
    for (IState state : context.getStates()) {

      File outf = getFileForState(state.getObservableClass());
      RasterCoverage cov = new RasterCoverage(context, state);
      try {
        cov.write(outf);
      } catch (ThinklabValidationException e) {
        ModellingPlugin.get()
            .logger()
            .error("could not write GeoTIFF for state " + state.getObservableClass());
      }
    }

    return getLocation();
  }