Skip to content

Commit

Permalink
legacyCellDirectionalConnections removed
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Nov 8, 2024
1 parent b05fb62 commit b37b015
Show file tree
Hide file tree
Showing 9 changed files with 5 additions and 36 deletions.
11 changes: 1 addition & 10 deletions source/EngineGpuKernels/CellFunctionProcessor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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];
Expand Down
4 changes: 1 addition & 3 deletions source/EngineGpuKernels/RenderingKernels.cu
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 2 additions & 6 deletions source/EngineInterface/PreviewDescriptionService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion source/EngineInterface/SimulationParameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
;
Expand Down
1 change: 0 additions & 1 deletion source/EngineInterface/SimulationParameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
Expand Down
2 changes: 1 addition & 1 deletion source/Gui/HelpStrings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down
7 changes: 0 additions & 7 deletions source/Gui/SimulationParametersWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
6 changes: 0 additions & 6 deletions source/PersisterInterface/AuxiliaryDataParserService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ void LegacyAuxiliaryDataParserService::activateParametersAndFeaturesForLegacyFil
if (programVersion.empty()) {
parameters.features.legacyModes = true;
parameters.legacyCellFunctionMuscleNoActivityReset = true;
parameters.legacyCellDirectionalConnections = true;
}

//*******************
Expand Down

0 comments on commit b37b015

Please sign in to comment.