Last change
on this file since 48 was
44,
checked in by mszubert, 14 years ago
|
cecj, framsticks and games packages imported
|
File size:
1004 bytes
|
Rev | Line | |
---|
[44] | 1 | package framsticks; |
---|
| 2 | |
---|
| 3 | import cecj.interaction.InteractionResult; |
---|
| 4 | import cecj.problems.TestBasedProblem; |
---|
| 5 | import cecj.utils.Pair; |
---|
| 6 | import ec.EvolutionState; |
---|
| 7 | import ec.Individual; |
---|
| 8 | |
---|
| 9 | public class FramsticksCoevolutionaryProblem extends TestBasedProblem { |
---|
| 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.