Examples of DetailedExperimentInfo


Examples of eu.planets_project.pp.plato.model.DetailedExperimentInfo

    public void updateSelectedExperimentInfo(Object alternative, Object sampleObject) {
       
        Alternative a = (Alternative)alternative;
        SampleObject so = (SampleObject)sampleObject;
       
        DetailedExperimentInfo info = a.getExperiment().getDetailedInfo().get(sampleObject);
       
        if (info == null) {
            info = new DetailedExperimentInfo();
            a.getExperiment().getDetailedInfo().put(so, info);
        }
       
        this.selectedExperimentInfo = info;
View Full Code Here

Examples of eu.scape_project.planning.model.DetailedExperimentInfo

     *            successful flag to set
     */
    private void setProgramOutputForAlternative(Alternative a, String msg, boolean successful) {
        List<SampleObject> sampleObjects = plan.getSampleRecordsDefinition().getRecords();
        for (SampleObject o : sampleObjects) {
            DetailedExperimentInfo info = a.getExperiment().getDetailedInfo().get(o);

            if (info == null) {
                info = new DetailedExperimentInfo();
                a.getExperiment().getDetailedInfo().put(o, info);
            }

            info.setProgramOutput(msg);
            info.setSuccessful(successful);
        }
    }
View Full Code Here

Examples of eu.scape_project.planning.model.DetailedExperimentInfo

     *            sample object of the experiment
     * @param migrationResult
     *            migration result of the experiment
     */
    private void extractDetailedInfos(Alternative a, SampleObject sample, MigrationResult migrationResult) {
        DetailedExperimentInfo info = a.getExperiment().getDetailedInfo().get(sample);
        if (info == null) {
            info = new DetailedExperimentInfo();
            a.getExperiment().getDetailedInfo().put(sample, info);
        }

        info.clear();

        if (migrationResult == null) {
            info.setProgramOutput(String.format("Applying action %s to sample %s failed.",
                a.getAction().getShortname(), sample.getFullname()));
        } else {
            info.setSuccessful(migrationResult.isSuccessful());

            if (migrationResult.getReport() == null) {
                info.setProgramOutput("The tool didn't provide any output.");
            } else {
                info.setProgramOutput(migrationResult.getReport());
            }

            // Execution claimed to be successful but size = 0
            DigitalObject migratedObject = migrationResult.getMigratedObject();
            if (migrationResult.isSuccessful() && (migratedObject == null || migratedObject.getData().getSize() == 0)) {
                info.setSuccessful(false);
                info.setProgramOutput(info.getProgramOutput()
                    + "\nSomething went wrong during migration. No result file has been generated.");
            }
           
            if (info.getSuccessful()) {
                info.getMeasurements().putAll(migrationResult.getMeasurements());               
            }
        }
    }
View Full Code Here

Examples of eu.scape_project.planning.model.DetailedExperimentInfo

        }
        return toolExp;
    }

    public static DetailedExperimentInfo getAverage(ToolExperience toolExp) {
        DetailedExperimentInfo averages = new DetailedExperimentInfo();
        for (String key : toolExp.getMeasurements().keySet()) {
            /* average can only calculated of numeric values */
            if (toolExp.getMeasurements().get(key).getList().get(0).getValue() instanceof INumericValue) {
                Measurement m = toolExp.getAverage(key);
                if (!Double.isInfinite(((INumericValue) m.getValue()).value()))
                    averages.getMeasurements().put(key, m);
            }
        }
        return averages;
    }
View Full Code Here

Examples of eu.scape_project.planning.model.DetailedExperimentInfo

        experiment.setSettings("Settings");
        experiment.setWorkflow(generateDigitalObject());

        Map<SampleObject, DetailedExperimentInfo> detailedInfo = experiment.getDetailedInfo();
        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

Examples of eu.scape_project.planning.model.DetailedExperimentInfo

            // }

            // export detailed experiment info's
            Element detailedInfos = experiment.addElement("detailedInfos");
            for (SampleObject record : exp.getDetailedInfo().keySet()) {
                DetailedExperimentInfo dinfo = exp.getDetailedInfo().get(record);
                Element detailedInfo = detailedInfos.addElement("detailedInfo")
                    .addAttribute("key", record.getShortName()).addAttribute("successful", "" + dinfo.getSuccessful());
                addStringElement(detailedInfo, "programOutput", dinfo.getProgramOutput());
                addStringElement(detailedInfo, "cpr", dinfo.getCpr());

                Element measurements = detailedInfo.addElement("measurements");
                for (Measurement m : dinfo.getMeasurements().values()) {
                    Element measurement = measurements.addElement("measurement");
                    measurement.addAttribute("measureId", m.getMeasureId());

                    // measurement.value:
                    String typename = deriveElementname(m.getValue().getClass());
View Full Code Here

Examples of eu.scape_project.planning.model.DetailedExperimentInfo

    public Value evaluate(Alternative alternative, SampleObject sample, DigitalObject result, String measureUri) {
        double sampleSize = sample.getData().getSize() * (1024 * 1024);

        if (MeasureConstants.AMOUNT_OF_LOGGING.equals(measureUri)) {
            Map<SampleObject, DetailedExperimentInfo> detailedInfo = alternative.getExperiment().getDetailedInfo();
            DetailedExperimentInfo detailedExperimentInfo = detailedInfo.get(sample);
            if ((detailedExperimentInfo != null) && (detailedExperimentInfo.getProgramOutput() != null)) {
                PositiveIntegerValue v = new PositiveIntegerValue();
                v.setValue(detailedExperimentInfo.getProgramOutput().length());
                v.setComment("extracted from experiment details");
                return v;
            }
            return null;
        } else if (MeasureConstants.FORMAT_OF_LOGGIN.equals(measureUri)) {
            Map<SampleObject, DetailedExperimentInfo> detailedInfo = alternative.getExperiment().getDetailedInfo();
            DetailedExperimentInfo detailedExperimentInfo = detailedInfo.get(sample);
            if ((detailedExperimentInfo != null) && (detailedExperimentInfo.getProgramOutput() != null)) {
                OrdinalValue v = new OrdinalValue();
                v.setValue(evaluateLogging(detailedExperimentInfo.getProgramOutput()));
                v.setComment("extracted from experiments details");
                return v;
            }
            return null;
        } else if (MeasureConstants.ELAPSED_TIME_PER_MB.equals(measureUri)) {
View Full Code Here

Examples of eu.scape_project.planning.model.DetailedExperimentInfo

     * @return
     */
    private Value extractMeasuredValue(Alternative alternative, SampleObject sample, String propertyURI) {

        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;
            }
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.