Package eu.planets_project.tb.api.model.benchmark

Examples of eu.planets_project.tb.api.model.benchmark.BenchmarkGoal


        Iterator<BenchmarkBean> iter = expBean.getExperimentBenchmarkBeans().iterator();
        log.debug("Found # of ExperimentOverall BMGS: " + expBean.getExperimentBenchmarkBeans().size());
        boolean bError = false;
        while (iter.hasNext()) {
          BenchmarkBean bmb = iter.next();
          BenchmarkGoal bmg;
          if (bmb.getSelected()) {
            // get the bmgoal from the evaluation data
            bmg = exp.getExperimentEvaluation().getEvaluatedExperimentBenchmarkGoal(bmb.getID());
                    expBMgoals.add(bmg);
                    /* FIXME ANJ Clean this up:
          try {
            //update the bmg with the provided bean's data
            helper_addBMBSettingsToBMGoal(bmb,bmg);
           
            expBMgoals.add(bmg);
            log.debug("updating bmg's target:" + bmg.getTargetValue());
           
          } catch (InvalidInputException e) {
            //create an ErrorMessage
                FacesMessage fmsg = new FacesMessage();
                if(bmg!=null){
                  fmsg.setSummary("Validation of "+bmg.getName()+" failed");
                  fmsg.setDetail("Validation of "+bmg.getName()+" failed");
                }
                else{
                  fmsg.setDetail("source/target value of a given file-Benchmarkgoal is not valid!"+e.toString());
                   fmsg.setSummary("source/target value of a given file-Benchmarkgoal is not valid!");
                }
                fmsg.setSeverity(FacesMessage.SEVERITY_ERROR);
              FacesContext ctx = FacesContext.getCurrentInstance();
              ctx.addMessage("bmTable",fmsg);
            log.error(e.toString());
            //set error true: all error messages are collected and then "failure" is returned
            bError = true;
          }
                    */
          }
        }
       
        //3. fill the file benchmark goals - used for evaluation of every input file
        boolean bError2 = false;
        Map<String,BenchmarkBean> mBMBs = expBean.getFileBenchmarkBeans();
        Map<URI,List<BenchmarkGoal>> mFileBMGs = new HashMap<URI,List<BenchmarkGoal>>();
        Iterator<String> itLocalInputFileRefs = expBean.getExperimentInputData().values().iterator();
        DataHandler dh = new DataHandlerImpl();
    
        //iterate over every input file and add update their evaluation
        BenchmarkGoal bmg =null;
        try {
          while(itLocalInputFileRefs.hasNext()){
          String localInputFileRef = itLocalInputFileRefs.next();
          URI inputURI = dh.get(localInputFileRef).getDownloadUri();
          List<BenchmarkGoal> lbmgs = new ArrayList<BenchmarkGoal>();
View Full Code Here


      //the information if a BMGoal can be used within an autoEvaluationService
         //Map<BMGoalID, EvaluationTestbedServiceTemplate>
         Map<String,TestbedServiceTemplate> mapAutoEvalSer = this.getSupportedAutoEvaluationBMGoals();
        
      while (iter.hasNext()) {
        BenchmarkGoal bmg = iter.next();
                Iterator<String> dtypeiter = expBean.getDtype().iterator();
                while (dtypeiter.hasNext()){
                    String currentType = dtypeiter.next();
                    DigitalObjectTypesImpl dtypeImpl = new DigitalObjectTypesImpl();
                    currentType = dtypeImpl.getDtypeName(currentType);
                    //only add the goals that match the already selected categories
                    if (currentType.equalsIgnoreCase(bmg.getCategory())) {
                        BenchmarkBean bmb = null;
                      if (availBenchmarks.containsKey(bmg.getID())) {
                                bmb = availBenchmarks.get(bmg.getID());
                                bmb.setSelected(true);
                               
                        } else {
                                bmb = new BenchmarkBean(bmg);       
                                bmb.setSelected(false);
                                availBenchmarks.put(bmg.getID(), bmb);
                        }
                       
                        //add the autoEvaluationService Information for this goal
                        if(mapAutoEvalSer.containsKey(bmg.getID())){
                          //note: currently every BMGoal only contains max. one autoEval services behind
                            /* FIXME ANJ Clean this up:
                          bmb.setAutoEvalService(mapAutoEvalSer.get(bmg.getID()));
                          */
                        }
View Full Code Here

        try {

        List<BenchmarkGoal> lFileEvalBMgoals = new ArrayList<BenchmarkGoal>();
        List<BenchmarkGoal> lExpOverallEvalBMgoals = new ArrayList<BenchmarkGoal>();
        for(BenchmarkGoal bmg : exp.getExperimentSetup().getAllAddedBenchmarkGoals()){
          BenchmarkGoal bmgEval = ((BenchmarkGoalImpl)bmg).clone();
          lFileEvalBMgoals.add(bmgEval);
          BenchmarkGoal bmgEval2 = ((BenchmarkGoalImpl)bmg).clone();
          lExpOverallEvalBMgoals.add(bmgEval2);
        }
       
        //fill the benchmark goals for every input file - used for evaluation
        Map<URI,Collection<BenchmarkGoal>> fileEvalBMGs = new HashMap<URI,Collection<BenchmarkGoal>>();
View Full Code Here

    }
    assertEquals("25",nop1.getSourceValue());
  }
 
  public void testTargetValue(){
    BenchmarkGoal nop1 = handler.getBenchmarkGoal(this.sGoalID);
   
    assertEquals("",nop1.getTargetValue());
   
    //Type is of java.lang.Integer
    try {
      nop1.setTargetValue("25");
    } catch (InvalidInputException e) {
      assertEquals(true,false);
    }
    assertEquals("25",nop1.getTargetValue());
   
    //Test: value was not valid and therefore did not change
    try {
      nop1.setTargetValue("true");
      assertEquals(true,false);
    } catch (InvalidInputException e) {
      assertEquals(true,true);
    }
    assertEquals("25",nop1.getTargetValue());
  }
View Full Code Here

    assertEquals("25",nop1.getTargetValue());
  }
 
 
  public void testEvaluationValue(){
    BenchmarkGoal nop1 = handler.getBenchmarkGoal(this.sGoalID);
   
    assertEquals("",nop1.getEvaluationValue());
    ExperimentEvaluation eval = new ExperimentEvaluationImpl();
    List<String> list = eval.getAllAcceptedEvaluationValues();
   
    assertEquals(4,list.size());
   
  //Test1:

    try {
      nop1.setEvaluationValue(list.get(0));
      assertEquals(list.get(0),nop1.getEvaluationValue());
      nop1.setEvaluationValue(list.get(1));
      assertEquals(list.get(1),nop1.getEvaluationValue());
    } catch (InvalidInputException e1) {
      assertEquals(true,false);
    }
  //Test2:
    try {
      nop1.setEvaluationValue("TestString");
      assertEquals(true,false);
    } catch (InvalidInputException e1) {
      assertEquals(true,true);
    }
  }
View Full Code Here

     
      String oldSourceValue="";
      String oldTargetValue="";
      String oldEvaluationValue="";
      if(this.experimentBenchmarkGoals.keySet().contains(addedBenchmarkGoalID)){
        BenchmarkGoal bmTemp = experimentBenchmarkGoals.get(addedBenchmarkGoalID);
        oldSourceValue = bmTemp.getSourceValue();
        oldTargetValue = bmTemp.getTargetValue();
        oldEvaluationValue = bmTemp.getEvaluationValue();
       
        //now remove the old goal - it's being replaced
        this.experimentBenchmarkGoals.remove(addedBenchmarkGoalID);
      }
     
View Full Code Here

  public void setEvaluatedExperimentBenchmarkGoals (
      List<BenchmarkGoal> lBMGoals) throws InvalidInputException{
    if((lBMGoals!=null)&&(lBMGoals.size()>0)){
      Iterator<BenchmarkGoal> itBMGoals = lBMGoals.iterator();
      while(itBMGoals.hasNext()){
        BenchmarkGoal bmGoal = itBMGoals.next();
       
        //some preconditions
        if((bmGoal!=null)){
          if(!bmGoal.getSourceValue().equals("")){
            //now set the value
            this.evaluateExperimentBenchmarkGoal(bmGoal.getID(), bmGoal.getSourceValue(),null,null);
          }
          if(!bmGoal.getTargetValue().equals("")){
            //now set the value
            this.evaluateExperimentBenchmarkGoal(bmGoal.getID(), null, bmGoal.getTargetValue(),null);
          }
          if(!bmGoal.getEvaluationValue().equals("")){
            //now set the value
            this.evaluateExperimentBenchmarkGoal(bmGoal.getID(), null ,null, bmGoal.getEvaluationValue());
          }
        }
      }
    }
   
View Full Code Here

      List<BenchmarkGoal> addedSourceBMGoals) throws InvalidInputException{
   
    if((addedSourceBMGoals!=null)&&(addedSourceBMGoals.size()>0)){
      Iterator<BenchmarkGoal> itBMGoals = addedSourceBMGoals.iterator();
      while(itBMGoals.hasNext()){
        BenchmarkGoal bmGoal = itBMGoals.next();
       
        //some preconditions
        if((bmGoal!=null)&&(!bmGoal.getSourceValue().equals(""))){
          //now start with the evaluation
          this.evaluateExperimentBenchmarkGoal(bmGoal.getID(), bmGoal.getSourceValue(),null, null);
        }
      }
    }
  }
View Full Code Here

      List<BenchmarkGoal> addedTargetBMGoals) throws InvalidInputException{
   
    if((addedTargetBMGoals!=null)&&(addedTargetBMGoals.size()>0)){
      Iterator<BenchmarkGoal> itBMGoals = addedTargetBMGoals.iterator();
      while(itBMGoals.hasNext()){
        BenchmarkGoal bmGoal = itBMGoals.next();
       
        //some preconditions
        if((bmGoal!=null)&&(!bmGoal.getTargetValue().equals(""))){
          //now start with the evaluation
          this.evaluateExperimentBenchmarkGoal(bmGoal.getID(), null, bmGoal.getTargetValue(), null);
        }
      }
    }
  }
View Full Code Here

     
      String oldSourceValue="";
      String oldTargetValue="";
      String oldEvaluationValue="";
      if(hmFileGoals.keySet().contains(addedBenchmarkGoalID)){
        BenchmarkGoal bmTemp = hmFileGoals.get(addedBenchmarkGoalID);
        oldSourceValue = bmTemp.getSourceValue();
        oldTargetValue = bmTemp.getTargetValue();
        oldEvaluationValue = bmTemp.getEvaluationValue();
        //now remove the old goal - it's being replaced
        hmFileGoals.remove(addedBenchmarkGoalID);
      }
     
      //set value:
View Full Code Here

TOP

Related Classes of eu.planets_project.tb.api.model.benchmark.BenchmarkGoal

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.