COSU.java [src/csip/api/server] Revision: default  Date:
/*
 * $Id$
 *
 * This file is part of the Cloud Services Integration Platform (CSIP),
 * a Model-as-a-Service framework, API and application suite.
 *
 * 2012-2022, Olaf David and others, OMSLab, Colorado State University.
 *
 * OMSLab licenses this file to you under the MIT license.
 * See the LICENSE file in the project root for more information.
 */
package csip.api.server;

import csip.cosu.ObjFunc;
import java.util.List;

/**
 * COSU support for services.
 *
 *
 * <blockquote><code>
 * 'metainfo':{
 * ...
 * 'cosu':
 * [{
 * 'name': 'flow1',
 * 'of' : kge,
 * "data": ['sim.csv', 'obs.csv'],
 * 'value': 2.35
 * },
 * {
 * ...
 * }
 * ]
 *
 * }
 *
 * }
 * 'parameter': [
 * ...
 * ]
 *
 * </code></blockquote>
 *
 *
 * @author odavid
 */
public interface COSU {

  /**
   * Check if the payload has cosu info.
   *
   * @return true if the metainfo has 'cosu' info, false otherwise.
   */
  boolean isSupported();


  /**
   * Get the cosu names (parameter names).
   *
   * @return the list of names.
   */
  List<String> getNames();


  /**
   * Get the objective function for the name.
   *
   * @param name the name
   * @return the Objective function instance
   */
  ObjFunc getObjFunc(String name);


  /**
   * Get the data info for the name
   *
   * @param name the name
   * @return the data info (sim, obs,...)
   */
  String[] getData(String name);


  /**
   * Set the value for the name
   *
   * @param name the name
   * @param value the value to set.
   */
  void setValue(String name, double value);

}