From b37b0157e1b45fa00051857f268e72b6e0fa5c4a Mon Sep 17 00:00:00 2001 From: Christian Heinemann Date: Fri, 8 Nov 2024 19:01:30 +0100 Subject: [PATCH] legacyCellDirectionalConnections removed --- source/EngineGpuKernels/CellFunctionProcessor.cuh | 11 +---------- source/EngineGpuKernels/RenderingKernels.cu | 4 +--- source/EngineInterface/PreviewDescriptionService.cpp | 8 ++------ source/EngineInterface/SimulationParameters.cpp | 1 - source/EngineInterface/SimulationParameters.h | 1 - source/Gui/HelpStrings.h | 2 +- source/Gui/SimulationParametersWindow.cpp | 7 ------- .../PersisterInterface/AuxiliaryDataParserService.cpp | 6 ------ .../LegacyAuxiliaryDataParserService.cpp | 1 - 9 files changed, 5 insertions(+), 36 deletions(-) diff --git a/source/EngineGpuKernels/CellFunctionProcessor.cuh b/source/EngineGpuKernels/CellFunctionProcessor.cuh index 251433cda..c37a8cd4e 100644 --- a/source/EngineGpuKernels/CellFunctionProcessor.cuh +++ b/source/EngineGpuKernels/CellFunctionProcessor.cuh @@ -86,12 +86,7 @@ __inline__ __device__ void CellFunctionProcessor::resetFetchedActivities(Simulat for (int i = 0, j = cell->numConnections; i < j; ++i) { auto otherExecutionOrderNumber = cell->connections[i].cell->executionOrderNumber; auto otherInputExecutionOrderNumber = cell->connections[i].cell->inputExecutionOrderNumber; - auto otherOutputBlocked = cell->connections[i].cell->outputBlocked; - bool flowToCell = !(cudaSimulationParameters.features.legacyModes && cudaSimulationParameters.legacyCellDirectionalConnections) - ? cell->inputExecutionOrderNumber == otherExecutionOrderNumber && !otherOutputBlocked - && cell->executionOrderNumber > otherInputExecutionOrderNumber - : false; - if (otherInputExecutionOrderNumber == cell->executionOrderNumber && !flowToCell) { + if (otherInputExecutionOrderNumber == cell->executionOrderNumber) { if (maxOtherExecutionOrderNumber == -1) { maxOtherExecutionOrderNumber = otherExecutionOrderNumber; } else { @@ -136,10 +131,6 @@ __inline__ __device__ Activity CellFunctionProcessor::calcInputActivity(Cell* ce if (connectedCell->outputBlocked || connectedCell->livingState != LivingState_Ready ) { continue; } - if (!(cudaSimulationParameters.features.legacyModes && cudaSimulationParameters.legacyCellDirectionalConnections) && connectedCell->inputExecutionOrderNumber == cell->executionOrderNumber - && connectedCell->executionOrderNumber > cell->executionOrderNumber && !cell->outputBlocked) { - continue; - } if (connectedCell->executionOrderNumber == cell->inputExecutionOrderNumber) { for (int i = 0; i < MAX_CHANNELS; ++i) { result.channels[i] += connectedCell->activity.channels[i]; diff --git a/source/EngineGpuKernels/RenderingKernels.cu b/source/EngineGpuKernels/RenderingKernels.cu index fd59aee1f..105ddc2a0 100644 --- a/source/EngineGpuKernels/RenderingKernels.cu +++ b/source/EngineGpuKernels/RenderingKernels.cu @@ -573,9 +573,7 @@ __global__ void cudaDrawCells( if (inputExecutionOrderNumber != -1 && inputExecutionOrderNumber != cell->executionOrderNumber) { for (int i = 0; i < cell->numConnections; ++i) { auto const& otherCell = cell->connections[i].cell; - auto flowToOtherCell = - otherCell->inputExecutionOrderNumber == cell->executionOrderNumber && cell->executionOrderNumber < otherCell->executionOrderNumber && !cell->outputBlocked; - if (otherCell->executionOrderNumber == inputExecutionOrderNumber && !otherCell->outputBlocked && !flowToOtherCell) { + if (otherCell->executionOrderNumber == inputExecutionOrderNumber && !otherCell->outputBlocked) { auto otherCellPos = otherCell->pos; auto topologyCorrection = map.getCorrectionIncrement(cellPos, otherCellPos); otherCellPos += topologyCorrection; diff --git a/source/EngineInterface/PreviewDescriptionService.cpp b/source/EngineInterface/PreviewDescriptionService.cpp index 96e3d312c..2dcbad5df 100644 --- a/source/EngineInterface/PreviewDescriptionService.cpp +++ b/source/EngineInterface/PreviewDescriptionService.cpp @@ -370,18 +370,14 @@ namespace ConnectionPreviewDescription connection; connection.cell1 = cell.pos; connection.cell2 = otherCell.pos; - auto flowToOtherCell = otherCell.inputExecutionOrderNumber.value_or(-1) == cell.executionOrderNumber && !cell.outputBlocked && otherCell.executionOrderNumber > cell.executionOrderNumber; connection.arrowToCell1 = inputExecutionOrderNumber == otherCell.executionOrderNumber && !otherCell.outputBlocked - && inputExecutionOrderNumber != cell.executionOrderNumber && !flowToOtherCell; - + && inputExecutionOrderNumber != cell.executionOrderNumber; result.connections.emplace_back(connection); cellIndicesToCreatedConnectionIndex.emplace(std::pair(connectionIndex, index), toInt(result.connections.size() - 1)); } else { auto connectionIndex = findResult->second; - auto flowToOtherCell = otherCell.inputExecutionOrderNumber.value_or(-1) == cell.executionOrderNumber && !cell.outputBlocked - && otherCell.executionOrderNumber > cell.executionOrderNumber; result.connections.at(connectionIndex).arrowToCell2 = inputExecutionOrderNumber == otherCell.executionOrderNumber - && !otherCell.outputBlocked && inputExecutionOrderNumber != cell.executionOrderNumber && !flowToOtherCell; + && !otherCell.outputBlocked && inputExecutionOrderNumber != cell.executionOrderNumber; } } ++index; diff --git a/source/EngineInterface/SimulationParameters.cpp b/source/EngineInterface/SimulationParameters.cpp index e9f1ee4ad..40165e26e 100644 --- a/source/EngineInterface/SimulationParameters.cpp +++ b/source/EngineInterface/SimulationParameters.cpp @@ -210,7 +210,6 @@ bool SimulationParameters::operator==(SimulationParameters const& other) const && legacyCellFunctionMuscleMovementAngleFromSensor == other.legacyCellFunctionMuscleMovementAngleFromSensor && muscleMovementVisualization == other.muscleMovementVisualization && legacyCellFunctionMuscleNoActivityReset == other.legacyCellFunctionMuscleNoActivityReset - && legacyCellDirectionalConnections == other.legacyCellDirectionalConnections && externalEnergyInflowOnlyForNonSelfReplicators == other.externalEnergyInflowOnlyForNonSelfReplicators && externalEnergyBackflowLimit == other.externalEnergyBackflowLimit ; diff --git a/source/EngineInterface/SimulationParameters.h b/source/EngineInterface/SimulationParameters.h index 6b1ad1cbc..d7c04ad48 100644 --- a/source/EngineInterface/SimulationParameters.h +++ b/source/EngineInterface/SimulationParameters.h @@ -211,7 +211,6 @@ struct SimulationParameters bool legacyCellFunctionMuscleMovementAngleFromSensor = false; bool legacyCellFunctionMuscleNoActivityReset = false; - bool legacyCellDirectionalConnections = false; bool operator==(SimulationParameters const& other) const; bool operator!=(SimulationParameters const& other) const { return !operator==(other); } diff --git a/source/Gui/HelpStrings.h b/source/Gui/HelpStrings.h index a6b654454..8996d6216 100644 --- a/source/Gui/HelpStrings.h +++ b/source/Gui/HelpStrings.h @@ -127,7 +127,7 @@ namespace Const "whose 'execution number' matches the specified 'input execution number', summing them up, and then setting the result to the " "activity states for the considered cell.\n\n2) The cell function is executed and can use the cell's activity states as input. " "The output is used to update the activity states again.\n\nSetting an 'input execution number' is optional. If none is set, the cell can " - "receive no input. Bidirectional connections are not allowed."; + "receive no input."; std::string const GenomeBlockOutputTooltip = "Activating this toggle, the cell's output can be locked, preventing any other cell from utilizing it as input."; diff --git a/source/Gui/SimulationParametersWindow.cpp b/source/Gui/SimulationParametersWindow.cpp index 8159c0fb0..e001d0762 100644 --- a/source/Gui/SimulationParametersWindow.cpp +++ b/source/Gui/SimulationParametersWindow.cpp @@ -1618,13 +1618,6 @@ void SimulationParametersWindow::processBase() .tooltip("If activated, the activity in channel #0 is not set to 0 in muscle cells which are in movement mode. Thus the output of this type " "of muscles can be reused for other muscle cells."), parameters.legacyCellFunctionMuscleNoActivityReset); - AlienImGui::Checkbox( - AlienImGui::CheckboxParameters() - .name("Allow bidirectional connections") - .textWidth(RightColumnWidth) - .defaultValue(origParameters.legacyCellDirectionalConnections) - .tooltip("If activated, two connected cells can receive each other's input if the 'input execution number' matches."), - parameters.legacyCellDirectionalConnections); AlienImGui::EndTreeNode(); } } diff --git a/source/PersisterInterface/AuxiliaryDataParserService.cpp b/source/PersisterInterface/AuxiliaryDataParserService.cpp index b95bbb49f..6f579145a 100644 --- a/source/PersisterInterface/AuxiliaryDataParserService.cpp +++ b/source/PersisterInterface/AuxiliaryDataParserService.cpp @@ -664,12 +664,6 @@ namespace defaultParameters.legacyCellFunctionMuscleNoActivityReset, "simulation parameters.legacy.cell.function.muscle.no activity reset", parserTask); - ParameterParser::encodeDecode( - tree, - parameters.legacyCellDirectionalConnections, - defaultParameters.legacyCellDirectionalConnections, - "simulation parameters.legacy.cell.bidirectional connections", - parserTask); //particle sources ParameterParser::encodeDecode( diff --git a/source/PersisterInterface/LegacyAuxiliaryDataParserService.cpp b/source/PersisterInterface/LegacyAuxiliaryDataParserService.cpp index e8b8f7c03..6624fb86a 100644 --- a/source/PersisterInterface/LegacyAuxiliaryDataParserService.cpp +++ b/source/PersisterInterface/LegacyAuxiliaryDataParserService.cpp @@ -173,7 +173,6 @@ void LegacyAuxiliaryDataParserService::activateParametersAndFeaturesForLegacyFil if (programVersion.empty()) { parameters.features.legacyModes = true; parameters.legacyCellFunctionMuscleNoActivityReset = true; - parameters.legacyCellDirectionalConnections = true; } //*******************