Package eu.planets_project.pp.plato.model.values

Examples of eu.planets_project.pp.plato.model.values.Value


                            CprProperty cprP =
                               compResult.get(0).getProperties().get(keyParts[1]);
                            if (cprP != null) {
                                String id = MetricToScaleMapping.getMetricId(keyParts[2]);
                                if (id != null) {
                                    Value v = null;                                   
                                    Scale s = MetricToScaleMapping.getScale(id);
                                    if (s == null) {
                                        // There is a new XCLMetric we have not registered in MetricToScaleMapping yet...
                                        log.debug("CPR: unkown metricId: " +  id);
                                    } else {
                                        // scale found, so we can create a value object
                                        v =  s.createValue();
                                        v.setScale(null);
                                       
                                        CprMetricResult mResult = cprP.getResultMetrics().get(id);
                                        if (mResult != null) {
                                            if ("ok".equals(mResult.getState())) {
                                                v.parse(mResult.getResult());
                                                v.setComment("xcdl values(sample::result)=(" + cprP.getSource()+"::" + cprP.getTarget()+")");
                                            } else {
                                                v.setComment(mResult.getResult());
                                            }
                                        }                                       
                                    }
                                    if (v != null) {
                                        Measurement m = new Measurement();
View Full Code Here


                        // Note:
                        // 1. there are only derived measurements in XCL
                        // 2. the fragment of an xcl - measurable property always corresponds to a xcl metric
                        String metricId = info.getFragment();
                       
                        Value v = null;
                        Scale s = descriptor.getMeasurementScale(info);
                        if (s != null) {
                            v = s.createValue();
                            v.setScale(null);
                        }
                        if ((metricId != null)&&(v != null)) {
                            CprMetricResult mResult = resultProperty.getResultMetrics().get(metricId);
                            if (mResult != null) {
                                if ("ok".equals(mResult.getState())) {
                                    v.parse(mResult.getResult());
                                    result.put(info, v);
                                    v.setComment("xcdl values(sample::result)=(" + resultProperty.getSource()+"::" + resultProperty.getTarget()+")");
                                } else {
                                    log.debug("evaluation failed: " + mResult.getResult());
                                }
                            }
                        }
View Full Code Here

       if (pservProperties != null) {
           try {
               String strValue = getEvaluationResult(propertyName, metricName);
               if (strValue != null) {
                   Scale s = MetricToScaleMapping.getScale(MetricToScaleMapping.getMetricId(metricName));
                   Value result = s.createValue();
                   result.setScale(null);
                   MetricToScaleMapping.setValueFromCprString(strValue, result);
                   return result;
               }
           }catch (Exception e) {
               PlatoLogger.getLogger(CompareResult.class).error("could not extract evaluation value: ", e);
View Full Code Here

                    String sessionID = null;
                    if (info == null) {
                        info = new DetailedExperimentInfo();                           
                        a.getExperiment().getDetailedInfo().put(sample, info);
                    } else {
                        Value sid = info.getMeasurements().get("sessionid").getValue();
                        if (sid != null && (sid instanceof FreeStringValue)) {
                       //     sessionID = ((FreeStringValue)sid).getValue();
                        }
                    }
                   
View Full Code Here

                if ((!l.isSingle() && v.size() != records.size()) ||
                       (l.isSingle() && v.size() > 1) ) {
                    log.error("---- INSANITY FOUND! ---- a values object with "+v.size()+" entries");
                }
                for (int i = 0; i < v.getList().size(); i++) {
                    Value value = v.getList().get(i);
                    if (value.getScale() == null)  {
                        if (discardedAlternativesNames.contains(e.getKey())) {
                            log.warn("Potential insantity found: record " + i + " for alternative "+e.getKey()+": Scale == null" );
                        } else {
                            log.error("------ INSANITY FOUND! record " + i + ": Scale == null" );
                        }
View Full Code Here

                measurementsToEval.addAll(allMeasurementsToEval);
                for (IActionEvaluator evaluator : actionEvaluators) {
                    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
View Full Code Here

TOP

Related Classes of eu.planets_project.pp.plato.model.values.Value

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.