MeltThenFreezePreferenceMutation extends TWEANNMutation { public void mutate(Genotype<TWEANN> genotype) { ((TWEANNGenotype) genotype).meltNetwork(); ((TWEANNGenotype) genotype).freezePreferenceNeurons(); } MeltThenFreezePreferenceMutation(); void mutate(Genotype<TWEANN> genotype);  }
@Test public void test() { for(NodeGene node : tg1.nodes) { if(node.ntype == Node.NTYPE_INPUT || node.ntype == Node.NTYPE_HIDDEN) { node.freeze(); assertEquals(node.isFrozen(), true); } } System.out.println("nodes before: " + tg1.nodes.toString()); mtfpm.mutate(tg1); System.out.println("nodes after: " + tg1.nodes.toString()); int numFrozen = 0; for(NodeGene node : tg1.nodes) { if(node.isFrozen()) { numFrozen++; } } assertTrue(numFrozen == tg1.numModules +1 || numFrozen == tg1.numModules + 2); }