diff --git a/source/EngineGpuKernels/CellFunctionProcessor.cuh b/source/EngineGpuKernels/CellFunctionProcessor.cuh index 845c142a1..251433cda 100644 --- a/source/EngineGpuKernels/CellFunctionProcessor.cuh +++ b/source/EngineGpuKernels/CellFunctionProcessor.cuh @@ -130,6 +130,7 @@ __inline__ __device__ Activity CellFunctionProcessor::calcInputActivity(Cell* ce return result; } + int numSensorActivities = 0; for (int i = 0, j = cell->numConnections; i < j; ++i) { auto connectedCell = cell->connections[i].cell; if (connectedCell->outputBlocked || connectedCell->livingState != LivingState_Ready ) { @@ -145,18 +146,17 @@ __inline__ __device__ Activity CellFunctionProcessor::calcInputActivity(Cell* ce result.channels[i] = max(-10.0f, min(10.0f, result.channels[i])); //truncate value to avoid overflow } if (connectedCell->activity.origin == ActivityOrigin_Sensor) { - if (result.origin != ActivityOrigin_Sensor) { - result.origin = ActivityOrigin_Sensor; - result.targetX = connectedCell->activity.targetX; - result.targetY = connectedCell->activity.targetY; - } else { - result.origin = ActivityOrigin_Unknown; - result.targetX = 0; - result.targetY = 0; - } + result.origin = ActivityOrigin_Sensor; + result.targetX += connectedCell->activity.targetX; + result.targetY += connectedCell->activity.targetY; + ++numSensorActivities; } } } + if (numSensorActivities > 0) { + result.targetX /= numSensorActivities; + result.targetY /= numSensorActivities; + } return result; } diff --git a/source/EngineGpuKernels/ConstructorProcessor.cuh b/source/EngineGpuKernels/ConstructorProcessor.cuh index 37bbf494b..15fe71e66 100644 --- a/source/EngineGpuKernels/ConstructorProcessor.cuh +++ b/source/EngineGpuKernels/ConstructorProcessor.cuh @@ -157,9 +157,7 @@ __inline__ __device__ void ConstructorProcessor::processCell(SimulationData& dat if (isConstructionTriggered(data, cell, activity)) { if (tryConstructCell(data, statistics, cell, constructionData)) { cellBuilt = true; - if (!constructionData.containsSelfReplication) { - cell->cellFunctionUsed = CellFunctionUsed_Yes; - } + cell->cellFunctionUsed = CellFunctionUsed_Yes; } } @@ -764,7 +762,8 @@ __inline__ __device__ bool ConstructorProcessor::checkAndReduceHostEnergy(Simula } } - auto externalEnergyConditionalInflowFactor = cudaSimulationParameters.externalEnergyConditionalInflowFactor[hostCell->color]; + auto externalEnergyConditionalInflowFactor = + cudaSimulationParameters.features.externalEnergyControl ? cudaSimulationParameters.externalEnergyConditionalInflowFactor[hostCell->color] : 0.0f; //if (isSelfReplicator(hostCell)) { // externalEnergyConditionalInflowFactor = 0; //} diff --git a/source/EngineGpuKernels/ParticleProcessor.cuh b/source/EngineGpuKernels/ParticleProcessor.cuh index 1d4c05779..a6e8ad7d2 100644 --- a/source/EngineGpuKernels/ParticleProcessor.cuh +++ b/source/EngineGpuKernels/ParticleProcessor.cuh @@ -300,7 +300,7 @@ __inline__ __device__ void ParticleProcessor::radiate(SimulationData& data, floa data.cellMap.correctPosition(pos); - auto externalEnergyBackflowFactor = cudaSimulationParameters.externalEnergyBackflowFactor[color]; + auto externalEnergyBackflowFactor = cudaSimulationParameters.features.externalEnergyControl ? cudaSimulationParameters.externalEnergyBackflowFactor[color] : 0.0f; auto particleEnergy = energy * (1.0f - externalEnergyBackflowFactor); if (particleEnergy > NEAR_ZERO) { diff --git a/source/Gui/StatisticsWindow.cpp b/source/Gui/StatisticsWindow.cpp index 23708378d..d32a61ff1 100644 --- a/source/Gui/StatisticsWindow.cpp +++ b/source/Gui/StatisticsWindow.cpp @@ -338,9 +338,9 @@ void _StatisticsWindow::processTimelineStatistics() ImGui::TableNextRow(); ImGui::TableSetColumnIndex(0); - processPlot(row++, &DataPointCollection::deviationGenomeComplexity, 2); + processPlot(row++, &DataPointCollection::varianceGenomeComplexity, 2); ImGui::TableSetColumnIndex(1); - AlienImGui::Text("Genome complexity\ndeviation"); + AlienImGui::Text("Genome complexity\nvariance"); ImGui::TableNextRow(); ImGui::TableSetColumnIndex(0);