@Test public void testMutationOnce() throws CloneNotSupportedException { GlobalSignalConcentration xAxis = new GlobalSignalConcentration(); GlobalSignalConcentration yAxis = new GlobalSignalConcentration(); GlobalSignalConcentration output = new GlobalSignalConcentration(); SignalProcessingWavelet processor = new SignalProcessingWavelet(xAxis, output); for (int index = 0; index < 500; index++) { processor = processor.mutate(1.0, xAxis); processor = processor.mutate(1.0, yAxis); processor = processor.mutate(1.0); } processor.preTick(); processor.tick(); }
private static SignalProcessingWavelet mutateXor( SignalProcessingWavelet processor, GlobalSignalConcentration xAxis, GlobalSignalConcentration yAxis) throws CloneNotSupportedException { // mutate until there are atleast 2 input signals and 1 output signal, 3 total // there will always be exactly 1 output signal SignalProcessingWavelet mutatedProcessor = processor; do { for (int mutationIndex = 0; mutationIndex < XOR_MUTATION_COUNT; mutationIndex++) { mutatedProcessor = mutatedProcessor.mutate(XOR_MUTABILITY, xAxis); mutatedProcessor = mutatedProcessor.mutate(XOR_MUTABILITY, yAxis); mutatedProcessor = mutatedProcessor.mutate(XOR_MUTABILITY); } } while (mutatedProcessor.getSignals().size() < 3); return mutatedProcessor; }