Package eu.scape_project.planning.model

Examples of eu.scape_project.planning.model.Alternative


     *            Alternative corresponding to the next file-upload.
     * @param sampleObj
     *            SampleObject corresponding to the next file-upload.
     */
    public void updateDataForNextUpload(Object alt, Object sampleObj) {
        Alternative alternative = (Alternative) alt;
        SampleObject sampleObject = (SampleObject) sampleObj;

        alternativeForNextUpload = alternative;
        sampleObjectForNextUpload = sampleObject;
    }
View Full Code Here


     *            Alternative of the wanted result file.
     * @param sampleObj
     *            SampleObject of the wanted result file.
     */
    public void downloadResultFile(Object alt, Object sampleObj) {
        Alternative alternative = (Alternative) alt;
        SampleObject sampleObject = (SampleObject) sampleObj;

        DigitalObject resultFile = null;

        try {
            resultFile = runExperiments.fetchResultFile(alternative, sampleObject);
        } catch (StorageException e) {
            log.error("Exception at trying to fetch result file for alternative " + alternative.getName()
                + "and sample " + sampleObject.getFullname(), e);
            facesMessages.addError("Unable to fetch result file. Please try again.");
        }

        if (resultFile != null) {
            downloader.download(resultFile);
        } else {
            log.debug("No result file exists for alternative " + alternative.getName() + " and sample "
                + sampleObject.getFullname() + ".");
        }
    }
View Full Code Here

     *            Alternative the file was uploaded for.
     * @param sampleObj
     *            Sample the file was uploaded for.
     */
    public void removeResultFile(Object alt, Object sampleObj) {
        Alternative alternative = (Alternative) alt;
        SampleObject sampleObject = (SampleObject) sampleObj;

        runExperiments.removeResultFile(alternative, sampleObject);
    }
View Full Code Here

    @Test
    public void testResetValues_Different_Scale_In_Alternatives() {
        Leaf l = new Leaf();
        l.setScale(new FloatScale());
        Alternative a = new Alternative("test", "test");
        List<Alternative> alternatives = new ArrayList<Alternative>();
        alternatives.add(a);

        Map<String, Values> map = new HashMap<String, Values>();
        Value v1 = new IntegerValue();
View Full Code Here

    }

    @Test
    public void testRemoveValues() {
        Leaf l = new Leaf();
        Alternative a = new Alternative("test", "test");
        List<Alternative> alternatives = new ArrayList<Alternative>();
        alternatives.add(a);

        Map<String, Values> map = new HashMap<String, Values>();
        Value v1 = new IntegerValue();
View Full Code Here

    public void exportToXml_alternative() throws PlanningException {
        Plan p = generateBasicPlan();

        AlternativesDefinition alternativesDefinition = new AlternativesDefinition();
        alternativesDefinition.setDescription("Description");
        Alternative alt1 = generateAlternative("Alternative 1");
        alternativesDefinition.addAlternative(alt1);
        Alternative alt2 = generateAlternative("Alternative 2");
        alternativesDefinition.addAlternative(alt2);
        p.setAlternativesDefinition(alternativesDefinition);

        Document doc = exporter.exportToXml(p);
View Full Code Here

     * @param name
     *            the alternative name
     * @return the alternative
     */
    private Alternative generateAlternative(String name) {
        Alternative a = new Alternative(name, "Description");
        a.setDiscarded(false);
        ResourceDescription resourceDescription = new ResourceDescription();
        a.setResourceDescription(resourceDescription);
        Experiment experiment = new Experiment();
        experiment.setDescription("Description");
        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

TOP

Related Classes of eu.scape_project.planning.model.Alternative

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.