Examples of SimpleTree

  • com.intellij.ui.treeStructure.SimpleTree
  • com.vaadin.client.SimpleTree
    @author Vaadin Ltd @deprecated as of 7.1. This class was mainly used by the old debug consolebut is retained for now for backwards compatibility.
  • de.timefinder.algo.graph.SimpleTree
    Used for the augmenting tree in KuhnMunkresAlgorithm @author Peter Karich, peat_hal 'at' users 'dot' sourceforge 'dot' net
  • org.apache.ctakes.utils.tree.SimpleTree
  • org.jamesii.core.util.graph.trees.SimpleTree
    This class merely defines a 'simple' tree that has {@link Integer} asvertices, {@link Double} as vertex and edge labels, and both vertices andlabels can be annotated by any {@link Object}. Creation date: 12.12.2006 @author Roland Ewald

  • Examples of org.apache.ctakes.utils.tree.SimpleTree

       *
       * It uses the method getSurroundingTree in a somewhat clever way to do the additional annotation
       * on the output string instead of the tree object.
       */
      public static SimpleTree getSurroundingTreeWithAnnotation(TreebankNode node, String string) {
        SimpleTree inner = getSimpleClone(node);
        SimpleTree outer = getSurroundingTree(node);
       
        String innerString = inner.toString();
        String outerString = outer.toString();
       
        String fullString = outerString.replace(innerString, "(" + string + " " + innerString + ")");
        return SimpleTree.fromString(fullString);   
      }
    View Full Code Here

    Examples of org.jamesii.core.util.graph.trees.SimpleTree

       * @return labelled graph that is a tree
       */
      public SimpleTree generateRandomTree(int numOfNodes,
          int approxNumberOfChildren) {

        SimpleTree tree = new SimpleTree(numOfNodes);
        tree.turnTreeCheckOff();

        int actualNodeNum = 1;
        double randomNumber = 0.0;

        ArrayList<Integer> nodesOnLevel = new ArrayList<>();
        nodesOnLevel.add(0);

        while (actualNodeNum < numOfNodes && nodesOnLevel.size() > 0) {

          ArrayList<Integer> oldLevel = nodesOnLevel;
          nodesOnLevel = new ArrayList<>();
          int randomParent =
              ((Double) (Math.floor(rand.nextDouble() * (oldLevel.size()))))
                  .intValue();
          addEdge(tree, actualNodeNum, oldLevel.get(randomParent));
          nodesOnLevel.add(actualNodeNum);
          actualNodeNum++;
          AbstractNormalDistribution normDist =
              new NormalDistribution(rand, 0., 1.);

          for (int i : oldLevel) {

            randomNumber =
                approxNumberOfChildren + 0.25 * approxNumberOfChildren
                    * normDist.getRandomNumber();

            while (randomNumber > 0.5 && actualNodeNum < numOfNodes) {
              addEdge(tree, actualNodeNum, i);
              nodesOnLevel.add(actualNodeNum);
              actualNodeNum++;
              randomNumber--;
            }
          }

        }

        for (int i = 0; i < numOfNodes; i++) {
          tree.setLabel(i, rand.nextDouble() * 10);
        }

        if (!tree.turnTreeCheckOn()) {
          throw new IllegalStateException("Problem with random tree creation");
        }

        tree.setTreeRoot(0);

        return tree;
      }
    View Full Code Here
    TOP
    Copyright © 2018 www.massapi.com. 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.