Package eu.planets_project.pp.plato.model.tree

Examples of eu.planets_project.pp.plato.model.tree.Leaf


     * Attaches a new Leaf to the given object (which is, hopefully, a Node)
     */
    public void addLeaf(Object object) {
        if (object instanceof Node) {
            Node node = (Node) object;
            node.addChild(new Leaf());
            log.debug("Leaf added: to NODE");
            // this node has been changed()
            node.touch();
            expandNode(node);
           
View Full Code Here


    public void setFileToAttach(DigitalObject fileToAttach) {
        this.fileToAttach = fileToAttach;
    }

    public void convertToNode(Object leaf) {
        Leaf l = (Leaf) leaf;
        l.getParent().convertToNode(l);
    }
View Full Code Here

     */
    private void initializeNodeRec(TreeNode node) {

        Hibernate.initialize(node);
        if (node.isLeaf()) {
            Leaf leaf = (Leaf) node;
            Transformer t = leaf.getTransformer();
            Hibernate.initialize(t);
            if (t instanceof OrdinalTransformer) {
                OrdinalTransformer nt = (OrdinalTransformer) t;
                Hibernate.initialize(nt.getMapping());
            }
            //log.debug("hibernate initialising Transformer: " + leaf.getTransformer());
            for (Values value : leaf.getValueMap().values()) {
                Hibernate.initialize(value);
            }
        } else if (node instanceof Node) {
            Node recnode = (Node) node;
            Hibernate.initialize(node.getChildren());
View Full Code Here

        initLeafLists();
        boolean xcl =  false;
        hasAutomatedMeasurements.setBool(false);
        Iterator<Leaf> iter = selectedPlan.getTree().getRoot().getAllLeaves().iterator();
        while (iter.hasNext()) {
            Leaf l = iter.next();
            if (l.isMapped()) {
                hasAutomatedMeasurements.setBool(true);
               
                if (l.getMeasurementInfo().getProperty().getName().startsWith("xcl/")) {
                    xcl = true;
                }
            }
        }
        if (xcl)  {
View Full Code Here

                    Map<MeasurementInfoUri, Value> results = evaluator.evaluate(alternative, measurementsToEval, this);
                    // apply all results
                    for (MeasurementInfoUri m : results.keySet()) {
                        Value value = results.get(m);
                        if (value != null) {
                            Leaf l = measurementOfLeaf.get(m);
                            value.setScale(l.getScale());
                            l.getValues(alternative.getName()).setValue(0,value);
                        }
                    }
                    // exclude evaluated leaves from further evaluation
                    measurementsToEval.removeAll(results.keySet());
                }
            }
            // then object evaluators
            List<IObjectEvaluator> objEvaluators = MiniRED.getInstance().getObjectEvaluationSequence();
            for (Alternative alternative : selectedPlan.getAlternativesDefinition().getConsideredAlternatives()) {
                // .. for all alternatives
                List<SampleObject> samples = selectedPlan.getSampleRecordsDefinition().getRecords();
                for (int i = 0; i < samples.size(); i++){
                    // we want to evaluate each property only once, by the evaluator with the highest priority
                    measurementsToEval.clear();
                    measurementsToEval.addAll(allMeasurementsToEval);
                   

                   
                    for (IObjectEvaluator evaluator : objEvaluators) {
                        DigitalObject r = alternative.getExperiment().getResults().get(samples.get(i));
                        DigitalObject r2 = (r == null ? null : em.merge(r));
                        try {
                            Map<MeasurementInfoUri, Value> results = evaluator.evaluate(
                                    alternative,
                                    em.merge(samples.get(i)),
                                    r2,
                                    measurementsToEval,
                                    this);
                            // apply all results
                            for (MeasurementInfoUri m : results.keySet()) {
                                Value value = results.get(m);
                                if (value != null) {
                                    Leaf l = measurementOfLeaf.get(m);
                                    value.setScale(l.getScale());
                                    // add evaluation result for the current result-object!
                                    l.getValues(alternative.getName()).setValue(i, value);
                                }
                            }
                            // exclude evaluated leaves from further evaluation
                            measurementsToEval.removeAll(results.keySet());
                        } catch (Exception e) {
View Full Code Here

     * Attaches a new Leaf to the given object (which is, hopefully, a Node)
     */
    public void addLeaf(Object object) {
        if (object instanceof Node) {
            Node node = (Node) object;
            node.addChild(new Leaf());
            log.debug("Leaf added: to NODE");
            // this node has been changed()
            node.touch();
            expandNode(node);
        }
View Full Code Here

    protected String getWorkflowstepName() {
        return "requirementsExpert";
    }

    public void convertToNode(Object leaf) {
        Leaf l = (Leaf) leaf;
        l.getParent().convertToNode(l);
    }
View Full Code Here

    }

    public void addCriterion(Object object) {
        if (object instanceof LibraryRequirement) {
            LibraryRequirement n = (LibraryRequirement)object;
            Leaf l = n.addCriterion();
            l.setName("<criterion name not set>");
            libraryTreeHelper.expand(n);
        }
    }
View Full Code Here

TOP

Related Classes of eu.planets_project.pp.plato.model.tree.Leaf

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.