package DE;

/**
 * Interface for objects representing a set of observed data that is to be
 * modelled.  Such objects must implement a means to compute the error of
 * a fit of a model defined by a ParameterSet to the observed data.  The
 * numerical methods implemented in this package will ensure that
 * computeError() is called at least once after all calls to ParameterSet.set()
 * are complete and before a ParameterSet is returned to the user.
 * Written by Chris Studholme
 * Licenced for redistribution under the GNU General Public Licence
 */
public interface ObservedDataSet {
    /* Compute error of fit to data.  Errors are expected to be >=0 with
     * lower values implying a more precise fit to the data.  This method
     * may update the internal state of the ParameterSet object but it
     * should try to avoid changing the parameters available through the
     * get() call in the ParameterSet interface; however, if any of the
     * parameters are outside their respective range of allowed values, 
     * they may be brought back into the appropriate range by this method.
     * Alternatively, this method may return Double.POSITIVE_INFINITY to
     * indicate that the ParameterSet is inconsistent.
     * @param parameters set of parameters to fit to data
     * @return computed error value
     */
    public double computeError(ParameterSet parameters);
}
