Skip to content

Commit

Permalink
useless property mutation restriction removed
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Sep 17, 2024
1 parent 3f877f6 commit d4c991a
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions source/EngineGpuKernels/MutationProcessor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,6 @@ __inline__ __device__ void MutationProcessor::propertiesMutation(SimulationData&
return;
}

//already fitting input-output connection? => use other input
auto executionNumber = GenomeDecoder::getNextInputExecutionNumber(genome, nodeAddress) % cudaSimulationParameters.cellNumExecutionOrderNumbers;
if (executionNumber == (prevInputExecutionNumber % cudaSimulationParameters.cellNumExecutionOrderNumbers)) {
prevExecutionNumber = nextExecutionNumber;
}
if (executionNumber == (nextInputExecutionNumber % cudaSimulationParameters.cellNumExecutionOrderNumbers)) {
nextExecutionNumber = prevExecutionNumber;
}

//basic property mutation
if (data.numberGen1.randomBool()) {
if (data.numberGen1.randomBool()) {
Expand Down Expand Up @@ -514,11 +505,11 @@ __inline__ __device__ void MutationProcessor::insertMutation(SimulationData& dat
data.numberGen1.randomBytes(targetGenome + nodeAddress, Const::CellBasicBytes);
GenomeDecoder::setNextCellFunctionType(targetGenome, nodeAddress, newCellFunction);
GenomeDecoder::setNextCellColor(targetGenome, nodeAddress, newColor);
if (data.numberGen1.random() < 0.9f) { //fitting input execution number should be often
if (data.numberGen1.random() < 0.9f) { //fitting input execution number should be more often
GenomeDecoder::setNextInputExecutionNumber(targetGenome, nodeAddress, data.numberGen1.randomBool() ? prevExecutionNumber : nextExecutionNumber);
}
if (data.numberGen1.random() < 0.9f) {
GenomeDecoder::setNextOutputBlocked(targetGenome, nodeAddress, false); //non-blocking output should be often
if (data.numberGen1.random() < 0.9f) { //non-blocking output should be more often
GenomeDecoder::setNextOutputBlocked(targetGenome, nodeAddress, false);
}
GenomeDecoder::setRandomCellFunctionData(data, targetGenome, nodeAddress + Const::CellBasicBytes, newCellFunction, makeSelfCopy, Const::GenomeHeaderSize);
if (newCellFunction == CellFunction_Constructor && !makeSelfCopy) {
Expand Down

0 comments on commit d4c991a

Please sign in to comment.