-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #669 from kusumotolab/introduce-parameter-object
SourceCodeValidation#execにパラメータオブジェクトを導入
- Loading branch information
Showing
7 changed files
with
74 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 4 additions & 7 deletions
11
src/main/java/jp/kusumotolab/kgenprog/ga/validation/DefaultCodeValidation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
package jp.kusumotolab.kgenprog.ga.validation; | ||
|
||
import jp.kusumotolab.kgenprog.project.GeneratedSourceCode; | ||
import jp.kusumotolab.kgenprog.project.test.TestResults; | ||
|
||
/** | ||
* テスト通過率をそのまま評価値とする評価方法 | ||
*/ | ||
public class DefaultCodeValidation implements SourceCodeValidation { | ||
|
||
/** | ||
* @param sourceCode 評価するソースコード | ||
* @param testResults ソースコードのテストの結果 | ||
* @param input 評価値計算に利用する情報 | ||
* @return 評価値 | ||
*/ | ||
@Override | ||
public Fitness exec(final GeneratedSourceCode sourceCode, final TestResults testResults) { | ||
return new SimpleFitness(testResults.getSuccessRate()); | ||
public Fitness exec(final Input input) { | ||
return new SimpleFitness(input.getTestResults() | ||
.getSuccessRate()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters