Changeset 59


Ignore:
Timestamp:
01/30/10 18:34:48 (14 years ago)
Author:
mszubert
Message:

Towards real coevolutionary evaluation.

File:
1 edited

Legend:

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

    r57 r59  
    160160        }
    161161
     162        @Deprecated
     163        public Pair<? extends InteractionResult> pseudoCoevolutionaryEvaluate(String candidate,
     164                        String test, String fileName) {
     165                float candidateResult = evaluateGenotype(candidate, fileName);
     166                float testResult = evaluateGenotype(test, fileName);
     167
     168                return new Pair<RealValuedResult>(new RealValuedResult(candidateResult),
     169                                new RealValuedResult(testResult));
     170        }
     171
    162172        public Pair<? extends InteractionResult> coevolutionaryEvaluate(String candidate, String test,
    163173                        String fileName) {
    164                 float candidateResult = evaluateGenotype(candidate, fileName);
    165                 float testResult = evaluateGenotype(test, fileName);
     174                String fileContents = String.format(GENOTYPE_DESC, candidate) + "\n"
     175                                + String.format(GENOTYPE_DESC, test);
     176                String filePath = workingDirectory + fileName;
     177                saveToFile(filePath, fileContents);
     178
     179                executeCommand(String.format(EVAL_CMD, executableCommand, experimentDefinition,
     180                                settingsFile, filePath));
     181                String evaluation = readFromFile(scriptsOutputPath);
     182               
     183                // TODO: parse output from eval
     184                // e.g. candidateResult = Float.parseFloat(evaluation.split("\t")[1]);
     185                float candidateResult = 0;
     186                float testResult = 0;           
    166187
    167188                return new Pair<RealValuedResult>(new RealValuedResult(candidateResult),
Note: See TracChangeset for help on using the changeset viewer.