Package eu.scape_project.planning.model.kbrowser

Examples of eu.scape_project.planning.model.kbrowser.CriteriaNode


        CriteriaLeaf leaf2 = new CriteriaLeaf();
        leaf2.setName("leaf2");
        CriteriaLeaf leaf3 = new CriteriaLeaf();
        leaf3.setName("leaf3");

        CriteriaNode subNode = new CriteriaNode();
        subNode.setName("subNode");
        subNode.addChild(leaf1);
        subNode.addChild(leaf2);

        CriteriaNode rootNode = new CriteriaNode();
        rootNode.setName("rootNode");
        rootNode.addChild(subNode);
        rootNode.addChild(leaf3);

        // create criteria-hierarchy
        CriteriaHierarchy cHierarchy = new CriteriaHierarchy();
        cHierarchy.setName("hierarchy");
        cHierarchy.setCriteriaTreeRoot(rootNode);
View Full Code Here


        Measure textQualityCrit = new Measure();
        textQualityCrit.setUri("outcome://object/image/textQuality");
        leaf3.setMeasure(textQualityCrit);
        leaf3.setMapped(true);

        CriteriaNode subNode = new CriteriaNode();
        subNode.setName("subNode");
        subNode.addChild(leaf1);
        subNode.addChild(leaf2);

        CriteriaNode rootNode = new CriteriaNode();
        rootNode.setName("rootNode");
        rootNode.addChild(subNode);
        rootNode.addChild(leaf3);

        // create criteria-hierarchy
        CriteriaHierarchy cHierarchy = new CriteriaHierarchy();
        cHierarchy.setName("hierarchy");
        cHierarchy.setCriteriaTreeRoot(rootNode);
View Full Code Here

        CriteriaLeaf leaf1 = new CriteriaLeaf();
        leaf1.setName("leaf1");
        leaf1.setMapped(true);
        leaf1.setMeasure(null);

        CriteriaNode rootNode = new CriteriaNode();
        rootNode.setName("rootNode");
        rootNode.addChild(leaf1);

        // create criteria-hierarchy
        CriteriaHierarchy cHierarchy = new CriteriaHierarchy();
        cHierarchy.setName("hierarchy");
        cHierarchy.setCriteriaTreeRoot(rootNode);
View Full Code Here

        }
       
        return leaf;
      // Node
        } else {
            CriteriaNode node = new CriteriaNode();

            node.setName(TEXT);

            for (Node n : children) {
              node.addChild(n.createCriteriaTreeNode(criteriaManager));
            }

            return node;
        }
    }
View Full Code Here

                hierarchy.getCriteriaTreeRoot().setNrOfRelevantPlans(planSelection.getSelectedPlans().size());

                for (CriteriaTreeNode criteriaTreeNode : hierarchy.getCriteriaTreeRoot().getAllSuccessiveTreeNodes()) {
                    // assign relevant data to criteria nodes
                    if (criteriaTreeNode instanceof CriteriaNode) {
                        CriteriaNode criteriaNode = (CriteriaNode) criteriaTreeNode;
                        criteriaNode.setNrOfRelevantPlans(planSelection.getSelectedPlans().size());
                    }
                    // assign relevant data to criteria leaves
                    if (criteriaTreeNode instanceof CriteriaLeaf) {
                        CriteriaLeaf criteriaLeaf = (CriteriaLeaf) criteriaTreeNode;
                        criteriaLeaf.setNrOfRelevantPlans(planSelection.getSelectedPlans().size());
View Full Code Here

        // Create a new hierarchy with a new root tree node and persist it.
        CriteriaHierarchy hierarchy = new CriteriaHierarchy();
        hierarchy.setName(name);

        // Assign relevant data to criteria root node.
        CriteriaNode rootNode = new CriteriaNode(planSelection.getSelectedPlans().size());
        rootNode.setName(name);
        rootNode.setNrOfRelevantPlans(planSelection.getSelectedPlans().size());

        hierarchy.setCriteriaTreeRoot(rootNode);
        em.persist(hierarchy);

        log.debug("Created CriteriaHierarchy with name [{}].", name);
View Full Code Here

            hierarchy.getCriteriaTreeRoot().setNrOfRelevantPlans(planSelection.getSelectedPlans().size());

            for (CriteriaTreeNode criteriaTreeNode : hierarchy.getCriteriaTreeRoot().getAllSuccessiveTreeNodes()) {
                // assign relevant data to criteria nodes
                if (criteriaTreeNode instanceof CriteriaNode) {
                    CriteriaNode criteriaNode = (CriteriaNode) criteriaTreeNode;
                    criteriaNode.setNrOfRelevantPlans(planSelection.getSelectedPlans().size());
                }
                // assign relevant data to criteria leaves
                if (criteriaTreeNode instanceof CriteriaLeaf) {
                    CriteriaLeaf criteriaLeaf = (CriteriaLeaf) criteriaTreeNode;
                    criteriaLeaf.setNrOfRelevantPlans(planSelection.getSelectedPlans().size());
View Full Code Here

        ArrayList<String> sourceLabels = new ArrayList<String>();
        ArrayList<Double> potentialSeries = new ArrayList<Double>();
        ArrayList<Double> rangeSeries = new ArrayList<Double>();

        // Get root of tree
        CriteriaNode treeRoot = selectedCriteriaSet.getCriteriaTreeRoot();

        // Add data of root
        sourceLabels.add(treeRoot.getName());
        potentialSeries.add(treeRoot.getImportanceFactorSIF4());
        rangeSeries.add(treeRoot.getImportanceFactorSIF6());

        // Add data of other structural nodes
        for (CriteriaTreeNode criteriaTreeNode : treeRoot.getAllSuccessiveTreeNodes()) {
            if (criteriaTreeNode instanceof CriteriaNode) {
                CriteriaNode criteriaNode = (CriteriaNode) criteriaTreeNode;
                sourceLabels.add(criteriaNode.getName());
                potentialSeries.add(criteriaNode.getImportanceFactorSIF4());
                rangeSeries.add(criteriaNode.getImportanceFactorSIF6());
            }
        }

        // Set data
        data.setSeriesLabels(seriesLabels);
View Full Code Here

        // Sort by SIF4
        Collections.sort(criteriaSets, Collections.reverseOrder(new Comparator<CriteriaHierarchy>() {
            @Override
            public int compare(CriteriaHierarchy set1, CriteriaHierarchy set2) {

                CriteriaNode treeRoot1 = set1.getCriteriaTreeRoot();
                CriteriaNode treeRoot2 = set2.getCriteriaTreeRoot();

                Double comp1 = new Double(treeRoot1.getImportanceFactorSIF7());
                Double comp2 = new Double(treeRoot2.getImportanceFactorSIF7());
                return comp1.compareTo(comp2);
            }

        }));

        // Create data object
        PotentialToRangeData data = new PotentialToRangeData();
        // Title
        data.setTitle("Maximum Impact to Average Impact");
        data.setSourcesTitle("Criteria sets");

        data.setFormatString("%.3f");

        // Label of series
        ArrayList<String> seriesLabels = new ArrayList<String>();
        seriesLabels.add("Maximum Impact");
        seriesLabels.add("Average Impact");

        // Data lists for criteria sets
        ArrayList<String> sourceLabels = new ArrayList<String>();
        ArrayList<Double> potentialSeries = new ArrayList<Double>();
        ArrayList<Double> rangeSeries = new ArrayList<Double>();

        for (CriteriaHierarchy criteriaSet : criteriaSets) {

            log.debug("Adding potential and range of node " + criteriaSet.getName());

            // Source label
            sourceLabels.add(criteriaSet.getName());

            // Get root of tree
            CriteriaNode treeRoot = criteriaSet.getCriteriaTreeRoot();

            // Add values
            potentialSeries.add(treeRoot.getImportanceFactorSIF7());
            rangeSeries.add(treeRoot.getImportanceFactorSIF6());
        }

        // Set data
        data.setSeriesLabels(seriesLabels);
        data.setSourceLabels(sourceLabels);
View Full Code Here

        ArrayList<String> sourceLabels = new ArrayList<String>();
        ArrayList<Double> potentialSeries = new ArrayList<Double>();
        ArrayList<Double> rangeSeries = new ArrayList<Double>();

        // Get root of tree
        CriteriaNode treeRoot = selectedCriteriaSet.getCriteriaTreeRoot();

        // Add data of root
        sourceLabels.add(treeRoot.getName());
        potentialSeries.add(treeRoot.getImportanceFactorSIF4());
        rangeSeries.add(treeRoot.getImportanceFactorSIF6());

        // Add data of other structural nodes
        for (CriteriaTreeNode criteriaTreeNode : treeRoot.getAllSuccessiveTreeNodes()) {
            if (criteriaTreeNode instanceof CriteriaNode) {
                CriteriaNode criteriaNode = (CriteriaNode) criteriaTreeNode;
                sourceLabels.add(criteriaNode.getName());
                potentialSeries.add(criteriaNode.getImportanceFactorSIF4());
                rangeSeries.add(criteriaNode.getImportanceFactorSIF6());
            }
        }

        // Set data
        data.setSeriesLabels(seriesLabels);
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.model.kbrowser.CriteriaNode

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.