Package org.encog.app.analyst

Examples of org.encog.app.analyst.AnalystError


        if (io.equalsIgnoreCase("input")) {
          isOutput = false;
        } else if (io.equalsIgnoreCase("output")) {
          isOutput = true;
        } else {
          throw new AnalystError("Unknown io type:" + io);
        }

        NormalizationAction des = null;
        if (action.equals("range")) {
          des = NormalizationAction.Normalize;
        } else if (action.equals("ignore")) {
          des = NormalizationAction.Ignore;
        } else if (action.equals("pass")) {
          des = NormalizationAction.PassThrough;
        } else if (action.equals("equilateral")) {
          des = NormalizationAction.Equilateral;
        } else if (action.equals("single")) {
          des = NormalizationAction.SingleField;
        } else if (action.equals("oneof")) {
          des = NormalizationAction.OneOf;
        } else {
          throw new AnalystError("Unknown field type:" + action);
        }

        final AnalystField nf = new AnalystField(name, des, high, low);
        nf.setTimeSlice(timeSlice);
        nf.setOutput(isOutput);
View Full Code Here


  private void validateProperty(final String section,
      final String subSection, final String name, final String value) {
    final PropertyEntry entry = PropertyConstraints.getInstance().getEntry(
        section, subSection, name);
    if (entry == null) {
      throw new AnalystError("Unknown property: "
          + PropertyEntry.dotForm(section, subSection, name));
    }
    entry.validate(section, subSection, name, value);
  }
View Full Code Here

    this.format = theFormat;
  }

  public String getField(String fieldName, int fieldIndex) {
    if (!map.containsKey(fieldName)) {
      throw new AnalystError("Unknown input field: " + fieldName);
    }

    int idx = map.get(fieldName);

    if (fieldIndex >= this.data.size() || fieldIndex < 0) {
      throw new AnalystError(
          "The specified temporal index "
              + fieldIndex
              + " is out of bounds.  You should probably increase the forward window size.");
    }
View Full Code Here

        break;
      case SingleField:
        out.addColumn("single");
        break;
      default:
        throw new AnalystError("Unknown action: " + field.getAction());
      }

      out.addColumn(field.getNormalizedHigh());
      out.addColumn(field.getNormalizedLow());
      out.writeLine();
View Full Code Here

      double theActualHigh, double theActualLow) {
    AnalystField field = new AnalystField();

    if (action == NormalizationAction.Equilateral
        || action == NormalizationAction.OneOf) {
      throw new AnalystError(
          "Must use defineClass if you are going to use Equilateral or OneOf");
    }

    // add underlying raw field
    DataField df = new DataField(fieldName);
View Full Code Here

      List<ClassItem> classes) {
    AnalystField field = new AnalystField();

    if (action != NormalizationAction.Equilateral
        && action != NormalizationAction.OneOf) {
      throw new AnalystError(
          "defineClass can only be used with action type of Equilateral or OneOf");
    }

    field.setAction(action);
    field.setNormalizedHigh(this.defaultNormalizedRangeHigh);
View Full Code Here

    for (final AnalystField norm : this.normalizedFields) {
      final DataField f = script.findDataField(norm.getName());

      if (f == null) {
        throw new AnalystError("Normalize specifies unknown field: "
            + norm.getName());
      }

      if (norm.getAction() == NormalizationAction.Normalize) {
        norm.setActualHigh(f.getMax());
View Full Code Here

        } else if ("list-string".equalsIgnoreCase(typeStr)) {
          t = PropertyType.TypeListString;
        } else if ("string".equalsIgnoreCase(typeStr)) {
          t = PropertyType.TypeString;
        } else {
          throw new AnalystError("Unknown type constraint: "
              + typeStr);
        }

        final PropertyEntry entry = new PropertyEntry(t, nameStr,
            sectionStr);
View Full Code Here

      final String subSection, final String name) {
    final String key = section.toUpperCase() + ":"
        + subSection.toUpperCase();
    final List<PropertyEntry> list = this.data.get(key);
    if (list == null) {
      throw new AnalystError("Unknown section and subsection: " + section
          + "." + subSection);
    }
    for (final PropertyEntry entry : list) {
      if (entry.getName().equalsIgnoreCase(name)) {
        return entry;
View Full Code Here

          result.append(PropertyEntry.dotForm(section, subSection,
              name));
          result.append(", value is ");
          result.append(value);
          result.append(".");
          throw new AnalystError(result.toString());
        }
        break;
      case TypeDouble:
        Double.parseDouble(value);
        break;
      case typeFormat:
        if (ConvertStringConst.string2AnalystFileFormat(value)
            == null) {
          final StringBuilder result = new StringBuilder();
          result.append("Invalid file format for ");
          result.append(PropertyEntry.dotForm(section, subSection,
              name));
          result.append(", value is ");
          result.append(value);
          result.append(".");
          throw new AnalystError(result.toString());
        }
        break;
      case TypeInteger:
        Integer.parseInt(value);
        break;
      case TypeListString:
        break;
      case TypeString:
        break;
      default:
        throw new AnalystError("Unsupported property type.");
      }
    } catch (final NumberFormatException ex) {
      final StringBuilder result = new StringBuilder();
      result.append("Illegal value for ");
      result.append(PropertyEntry.dotForm(section, subSection, name));
      result.append(", expecting a ");
      result.append(getEntryType().toString());
      result.append(", but got ");
      result.append(value);
      result.append(".");
      throw new AnalystError(result.toString());
    }
  }
View Full Code Here

TOP

Related Classes of org.encog.app.analyst.AnalystError

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.