Package eu.scape_project.planning.model.measurement

Examples of eu.scape_project.planning.model.measurement.Measurement


       
        String dbg = "real:" + p.getReal()+",user:"+p.getUser()+",sys:"+p.getSys();
        LoggerFactory.getLogger(this.getClass()).debug("TIME measured: " + dbg);
       
        for (Measure measure: getMeasures()) {
            Measurement m = new Measurement();
            m.setMeasureId(measure.getUri());
            PositiveFloatValue v = (PositiveFloatValue) measure.getScale().createValue();
           
            if (measure.getUri().equals(MeasureConstants.ELAPSED_TIME_PER_OBJECT)) {
                v.setValue((p.getUser()+p.getSys())*1000);
            }
           
            m.setValue(v);
            result.getMeasurements().put(measure.getUri(), m);
        }
    }   
View Full Code Here


            // Measures
            Map<String, ?> outputData = tavernaExecutor.getOutputData();
            Map<String, Measurement> measurements = new HashMap<String, Measurement>();
            for (Entry<String, ?> outputEntry : outputData.entrySet()) {
                Measurement measurement = createMeasurement(outputEntry.getKey(), outputEntry.getValue());
                if (measurement != null) {
                    measurements.put(measurement.getMeasureId(), measurement);
                }
            }
            result.setMeasurements(measurements);
        } catch (IOException e) {
            throw new PlatoException("Error communicating with the server.", e);
View Full Code Here

     * @param value
     *            the measured value
     * @return a measurement
     */
    private Measurement createMeasurement(String measureId, Object value) {
        Measurement measurement = null;
        String measureUri = T2FlowExecutablePlanGenerator.guessMeasureUrl(measureId);
        if (measureUri != null) {
            Measure measure = cm.getMeasure(measureUri);
            if (measure != null) {
                Value v = measure.getScale().createValue();
                try {
                    v.parse(value.toString());
                    // The measurement value does not need a scale
                    v.setScale(null);
                    measurement = new Measurement();
                    measurement.setMeasureId(measureUri);
                    measurement.setValue(v);
                } catch (Exception e) {
                    // Catch parsing exceptions
                    log.debug("Error parsing measure value", e);
                }
            }
View Full Code Here

        List<SampleObject> samples = plan.getSampleRecordsDefinition().getRecords();

        List<Leaf> leaves = plan.getTree().getRoot().getAllLeaves();
        for (Leaf leaf : leaves) {
            if (leaf.isMapped()) {
                Measurement measurement = measurements.get(leaf.getMeasure().getUri());
                if (measurement != null && measurement.getValue() != null) {
                    Value value = leaf.getScale().createValue();
                    value.setComment(measurement.getValue().getComment());
                    try {
                        value.parse(measurement.getValue().toString());
                    } catch (Exception e) {
                        // Catch parsing exceptions
                        log.debug("Error parsing measure value", e);
                    }
                    int i = samples.indexOf(sample);
View Full Code Here

                        settings);
        // provide a nice name for the resulting object
        setResultName(result, digitalObject);
        long duration = (System.nanoTime()-start)/(1000000);
        service.addExperience(result.getFeedbackKey(), action.getUrl(),
                new Measurement("roundtripTimeMS",new Double(duration)));
        return result;
    }
View Full Code Here

        Map<SampleObject, DetailedExperimentInfo> detailedInfo = alternative.getExperiment().getDetailedInfo();
        DetailedExperimentInfo detailedExperimentInfo = detailedInfo.get(sample);
        if (detailedExperimentInfo != null) {
            // retrieve the key of minimee's measuredProperty
            String measuredProperty = propertyToMeasuredValues.get(propertyURI);
            Measurement m = detailedExperimentInfo.getMeasurements().get(measuredProperty);
            if (m != null) {
                return m.getValue();
            } else {
                return null;
            }
        } else {
            return null;
View Full Code Here

        SampleObject sample1 = new SampleObject("Short name");
        DetailedExperimentInfo experimentInfo1 = new DetailedExperimentInfo();
        experimentInfo1.setSuccessful(true);
        experimentInfo1.setCpr("Cpr");
        experimentInfo1.setProgramOutput("Program output");
        experimentInfo1.getMeasurements().put("key", new Measurement("Measure id", "Value"));
        detailedInfo.put(sample1, experimentInfo1);

        a.setExperiment(experiment);
        return a;
    }
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.model.measurement.Measurement

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.