Package com.yahoo.labs.taxomo.util

Examples of com.yahoo.labs.taxomo.util.SymbolTransitionFrequencies$Coordinate


  SymbolTransitionFrequencies[] getFrequencyTables() throws IOException {
    logger.info("Reading the elements to update per-cluster frequency tables");

    // Create empty frequency tables
    SymbolTransitionFrequencies symbolFrequencyTable[] = new SymbolTransitionFrequencies[nClusters];
    for (int i = 0; i < nClusters; i++) {
      symbolFrequencyTable[i] = new SymbolTransitionFrequencies(tree);
    }

    // Read input file line by line
    BufferedReader reader = new BufferedReader(new FileReader(inFile));
    String line;
View Full Code Here


    // Clear auxiliary vector
    Arrays.fill(aux, 0);

    // Update frequency tables
    SymbolTransitionFrequencies symbolFrequencyTables[] = getFrequencyTables();

    // Get best models
    learnModelSettingBestModel(symbolFrequencyTables);

    // Evaluate nearest-neighbors
View Full Code Here

      logger.info( "Will use weight1=" + weight1 );
    }
   
    // Read input file
    logger.info("Reading input file");
    SymbolTransitionFrequencies symbolTransitions = new SymbolTransitionFrequencies(tree);
    symbolTransitions.processFile(inputFile);

    // Learning
    LearnModel learner = new LearnModel(tree, symbolTransitions, initialCandidate, strategy, weight1);
    if (jsapResult.userSpecified("max-iterations")) {
      learner.setMaxIterations(jsapResult.getInt("max-iterations"));
View Full Code Here

  Class<SearchStrategy> strategy;

  @Before
  public void setUp() throws Exception {
    taxo1 = new Taxonomy(TAXOFILE1, LearnModelTest.class.getResourceAsStream(TAXOFILE1));
    sym1 = new SymbolTransitionFrequencies(taxo1);
    sym1.processStream(LearnModelTest.class.getResourceAsStream(SEQFILE1));
    LearnModel.logger.setLevel(Level.ERROR);
    strategy = getStrategy(CloserToOrigin.class.getName());
  }
View Full Code Here

     *     required parameter
     * @return
     *     <tt>true</tt> (as general contract of <tt>Collection.add</tt>).
     */
    public LatLonQuad addToCoordinates(final double longitude, final double latitude) {
        this.getCoordinates().add(new Coordinate(longitude, latitude));
        return this;
    }
View Full Code Here

     *     required parameter
     * @return
     *     <tt>true</tt> (as general contract of <tt>Collection.add</tt>).
     */
    public LatLonQuad addToCoordinates(final double longitude, final double latitude, final double altitude) {
        this.getCoordinates().add(new Coordinate(longitude, latitude, altitude));
        return this;
    }
View Full Code Here

     *     required parameter
     * @return
     *     <tt>true</tt> (as general contract of <tt>Collection.add</tt>).
     */
    public LatLonQuad addToCoordinates(final String coordinates) {
        this.getCoordinates().add(new Coordinate(coordinates));
        return this;
    }
View Full Code Here

            if(JTSLine == null) continue;
            int lineLength = JTSLine.getNumPoints();
        List<Coordinate> coordsList = new ArrayList<Coordinate>();
        for (int i=0;i<lineLength;i++) {
         
          Coordinate coord = new Coordinate(JTSLine.getPointN(i).getX(),JTSLine.getPointN(i).getY());
          coordsList.add(coord);
        }

        if (coordsList.size() == 0)
          continue;
View Full Code Here

      outerboundary.setLinearRing(outerlinearring);

      List<Coordinate> outercoord = new ArrayList<Coordinate>();
      outerlinearring.setCoordinates(outercoord);
      for (int i=0;i<polygon.getExteriorRing().getNumPoints();i++) {
        outercoord.add(new Coordinate(polygon.getExteriorRing().getPointN(i).getX(),polygon.getExteriorRing().getPointN(i).getY()));
      }
     
      int numOfInnerBoundaries = polygon.getNumInteriorRing();
      for(int i=0;i<numOfInnerBoundaries;i++)
      {
        final Boundary innerboundary = new Boundary();
        kmlPolygon.getInnerBoundaryIs().add(innerboundary);
 
        final LinearRing innerlinearring = new LinearRing();
        innerboundary.setLinearRing(innerlinearring);
 
        List<Coordinate> innercoord = new ArrayList<Coordinate>();
        innerlinearring.setCoordinates(innercoord);
        int numOfPoints = polygon.getInteriorRingN(i).getNumPoints();
        for(int j=0;j<numOfPoints;j++)
          innercoord.add(new Coordinate(polygon.getInteriorRingN(i).getPointN(j).getX(),polygon.getInteriorRingN(i).getPointN(j).getY()));
       
      }
     
     
    }
View Full Code Here

     *     required parameter
     * @return
     *     <tt>true</tt> (as general contract of <tt>Collection.add</tt>).
     */
    public LatLonQuad addToCoordinates(final double longitude, final double latitude) {
        this.getCoordinates().add(new Coordinate(longitude, latitude));
        return this;
    }
View Full Code Here

TOP

Related Classes of com.yahoo.labs.taxomo.util.SymbolTransitionFrequencies$Coordinate

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.