Last change
on this file since 811 was
193,
checked in by Maciej Komosinski, 10 years ago
|
Set svn:eol-style native for all textual files
|
-
Property svn:eol-style set to
native
|
File size:
1022 bytes
|
Line | |
---|
1 | package framsticks; |
---|
2 | |
---|
3 | import cecj.interaction.InteractionResult; |
---|
4 | import cecj.problems.SymmetricTestBasedProblem; |
---|
5 | import cecj.utils.Pair; |
---|
6 | import ec.EvolutionState; |
---|
7 | import ec.Individual; |
---|
8 | |
---|
9 | public class FramsticksCoevolutionaryProblem extends SymmetricTestBasedProblem { |
---|
10 | |
---|
11 | @Override |
---|
12 | public Pair<? extends InteractionResult> test(EvolutionState state, Individual candidate, |
---|
13 | Individual test) { |
---|
14 | |
---|
15 | if (!(candidate instanceof FramsticksIndividual) || !(test instanceof FramsticksIndividual)) { |
---|
16 | state.output |
---|
17 | .error("The individuals for this problem should be of class FramsticksIndividual.\n"); |
---|
18 | } |
---|
19 | |
---|
20 | FramsticksIndividual framstickCandidate = (FramsticksIndividual) candidate; |
---|
21 | FramsticksIndividual framstickTest = (FramsticksIndividual) test; |
---|
22 | |
---|
23 | // TODO: Prepare for multithreading |
---|
24 | String fileName = "coevolutionary_evaluation_thread.gen"; |
---|
25 | |
---|
26 | FramsticksUtils utils = FramsticksUtils.getInstance(state); |
---|
27 | return utils.coevolutionaryEvaluate(framstickCandidate.genotype, framstickTest.genotype, |
---|
28 | fileName); |
---|
29 | } |
---|
30 | |
---|
31 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.