Changeset 61 for java


Ignore:
Timestamp:
02/08/10 20:20:00 (14 years ago)
Author:
mszubert
Message:

Parsing 2-genotype-evaluation results.
Parameters file updated.

Location:
java/ecj/framsticks
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • java/ecj/framsticks/FramsticksUtils.java

    r59 r61  
    169169                                new RealValuedResult(testResult));
    170170        }
     171       
     172        private static float chasingBest = 2.0f;
     173        private static float chasedBest = 2.0f;
    171174
    172175        public Pair<? extends InteractionResult> coevolutionaryEvaluate(String candidate, String test,
     
    180183                                settingsFile, filePath));
    181184                String evaluation = readFromFile(scriptsOutputPath);
     185
     186                float candidateResult = 0;
     187                float testResult      = 0;
    182188               
    183                 // TODO: parse output from eval
    184                 // e.g. candidateResult = Float.parseFloat(evaluation.split("\t")[1]);
    185                 float candidateResult = 0;
    186                 float testResult = 0;           
     189                try {
     190                       
     191                        String[] str = evaluation.split("\n");
     192                        candidateResult = Float.parseFloat(str[0].split("\t")[1]); //chasing
     193                        testResult      = Float.parseFloat(str[1].split("\t")[1]); //chased
     194                       
     195                        chasingBest = ((candidateResult < chasingBest)?(candidateResult):(chasingBest));
     196                        chasedBest  = ((chasedBest      < testResult )?(chasedBest     ):(testResult));
     197                       
     198                        System.out.printf("%7.4f %7.4f --> %7.4f %7.4f\n", candidateResult, chasingBest, testResult, chasedBest);
     199                }
     200                catch(Exception ex) {
     201                       
     202                        System.out.println(scriptsOutputPath + " in bad format. There must be 2 lines with results.");
     203                }
    187204
    188205                return new Pair<RealValuedResult>(new RealValuedResult(candidateResult),
Note: See TracChangeset for help on using the changeset viewer.