Rev | Line | |
---|
[44] | 1 | package framsticks; |
---|
| 2 | |
---|
| 3 | import cecj.interaction.InteractionResult; |
---|
[53] | 4 | import cecj.problems.SymmetricTestBasedProblem; |
---|
[44] | 5 | import cecj.utils.Pair; |
---|
| 6 | import ec.EvolutionState; |
---|
| 7 | import ec.Individual; |
---|
| 8 | |
---|
[53] | 9 | public class FramsticksCoevolutionaryProblem extends SymmetricTestBasedProblem { |
---|
[44] | 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.