Package org.encog.app.quant

Examples of org.encog.app.quant.QuantError


   * @param dt
   *            The date/time where the bar begins.
   */
  public final void beginBar(final Date dt) {
    if (this.tw == null) {
      throw new QuantError("Must open file first.");
    }

    if (this.line != null) {
      throw new QuantError("Must call end bar");
    }

    this.line = new StringBuilder();
    this.line.append(NumericDateUtil.date2Long(dt));
    this.line.append(this.format.getSeparator());
View Full Code Here


  /**
   * Close the file.
   */
  public final void close() {
    if (this.tw == null) {
      throw new QuantError("Must open file first.");
    }
    this.tw.close();
  }
View Full Code Here

  /**
   * End the current bar.
   */
  public final void endBar() {
    if (this.tw == null) {
      throw new QuantError("Must open file first.");
    }

    if (this.line == null) {
      throw new QuantError("Must call BeginBar first.");
    }

    if (this.headers && !this.columnsDefined) {
      writeHeaders();
    }
View Full Code Here

    try {
      this.tw = new PrintWriter(new FileWriter(filename));
      this.format = theFormat;
      this.headers = theHeaders;
    } catch (final IOException e) {
      throw new QuantError(e);
    }
  }
View Full Code Here

   * @param d
   *            The value to store.
   */
  public final void storeColumn(final String name, final double d) {
    if (this.line == null) {
      throw new QuantError("Must call BeginBar first.");
    }

    if (this.line.length() > 0) {
      this.line.append(this.format.getSeparator());
    }
View Full Code Here

  /**
   * Write the headers.
   */
  private void writeHeaders() {
    if (this.tw == null) {
      throw new QuantError("Must open file first.");
    }

    final StringBuilder theLine = new StringBuilder();

    theLine.append(FileData.DATE);
View Full Code Here

      break;
    case SingleField:
      resultIndex = (int) data[0];
      break;
    default:
      throw new QuantError("Unknown action: " + action);
    }

    return this.classes.get(resultIndex);
  }
View Full Code Here

   */
  public final void init() {

    if (this.action == NormalizationAction.Equilateral) {
      if (this.classes.size() < Equilateral.MIN_EQ) {
        throw new QuantError(
            "There must be at least three classes "
            + "to make use of equilateral normalization.");
      }

      this.eq = new Equilateral(this.classes.size(), this.normalizedHigh,
View Full Code Here

      final int low) {

    if ((theAction != NormalizationAction.Equilateral)
        && (theAction != NormalizationAction.OneOf)
        && (theAction != NormalizationAction.SingleField)) {
      throw new QuantError("Unsupported normalization type");
    }

    this.action = theAction;
    this.classes.clear();
    this.normalizedHigh = high;
View Full Code Here

      final String[] cls,
      final double high, final double low) {
    if ((theAction != NormalizationAction.Equilateral)
        && (theAction != NormalizationAction.OneOf)
        && (theAction != NormalizationAction.SingleField)) {
      throw new QuantError("Unsupported normalization type");
    }

    this.action = theAction;
    this.classes.clear();
    this.normalizedHigh = high;
View Full Code Here

TOP

Related Classes of org.encog.app.quant.QuantError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.