Skip to content

Commit

Permalink
enums for sensor and reconnector renamed
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Sep 16, 2024
1 parent 0dbbef9 commit 73db528
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions source/EngineGpuKernels/ReconnectorProcessor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ __inline__ __device__ void ReconnectorProcessor::tryCreateConnection(SimulationD
&& (otherCell->mutationId == cell->mutationId || otherCell->mutationId == 0 || otherCell->mutationId == 1)) {
return;
}
if (reconnector.restrictToMutants == ReconnectorRestrictToMutants_RestrictToZeroMutants && otherCell->mutationId != 0) {
if (reconnector.restrictToMutants == ReconnectorRestrictToMutants_RestrictToHandcraftedCells && otherCell->mutationId != 0) {
return;
}
if (reconnector.restrictToMutants == ReconnectorRestrictToMutants_RestrictToRespawnedMutants && otherCell->mutationId != 1) {
if (reconnector.restrictToMutants == ReconnectorRestrictToMutants_RestrictToFreeCells && otherCell->mutationId != 1) {
return;
}
if (reconnector.restrictToMutants == ReconnectorRestrictToMutants_RestrictToLessComplexMutants
Expand Down
10 changes: 5 additions & 5 deletions source/EngineGpuKernels/SensorProcessor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ __inline__ __device__ uint32_t SensorProcessor::getCellDensity(
if (restrictToMutants == SensorRestrictToMutants_RestrictToOtherMutants) {
result = densityMap.getOtherMutantDensity(timestep, scanPos, cell->mutationId);
}
if (restrictToMutants == SensorRestrictToMutants_RestrictToEmergentCells) {
if (restrictToMutants == SensorRestrictToMutants_RestrictToFreeCells) {
result = densityMap.getEmergentCellDensity(scanPos);
}
if (restrictToMutants == SensorRestrictToMutants_RestrictToZeroMutants) {
if (restrictToMutants == SensorRestrictToMutants_RestrictToHandcraftedCells) {
result = densityMap.getZeroMutantDensity(scanPos);
}
if (restrictToMutants == SensorRestrictToMutants_RestrictToLessComplexMutants) {
Expand Down Expand Up @@ -161,7 +161,7 @@ SensorProcessor::searchNeighborhood(SimulationData& data, SimulationStatistics&

uint32_t density = 0;
if (!blockedByWall[angleIndex]) {
if (restrictToMutants == SensorRestrictToMutants_NoRestriction || restrictToMutants == SensorRestrictToMutants_RestrictToZeroMutants
if (restrictToMutants == SensorRestrictToMutants_NoRestriction || restrictToMutants == SensorRestrictToMutants_RestrictToHandcraftedCells
|| densityMap.getZeroMutantDensity(scanPos) == 0) {
density = getCellDensity(data.timestep, cell, restrictToColor, restrictToMutants, densityMap, scanPos);
} else {
Expand Down Expand Up @@ -323,10 +323,10 @@ __inline__ __device__ void SensorProcessor::flagDetectedCells(SimulationData& da
|| static_cast<uint16_t>(cell->mutationId & 0xffff) == otherCell->ancestorMutationId)) {
continue;
}
if (restrictToMutants == SensorRestrictToMutants_RestrictToEmergentCells && otherCell->mutationId != 1) {
if (restrictToMutants == SensorRestrictToMutants_RestrictToFreeCells && otherCell->mutationId != 1) {
continue;
}
if (restrictToMutants == SensorRestrictToMutants_RestrictToZeroMutants && otherCell->mutationId != 0) {
if (restrictToMutants == SensorRestrictToMutants_RestrictToHandcraftedCells && otherCell->mutationId != 0) {
continue;
}
if (restrictToMutants == SensorRestrictToMutants_RestrictToLessComplexMutants
Expand Down
8 changes: 4 additions & 4 deletions source/EngineInterface/CellFunctionConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ enum SensorRestrictToMutants_
SensorRestrictToMutants_NoRestriction,
SensorRestrictToMutants_RestrictToSameMutants,
SensorRestrictToMutants_RestrictToOtherMutants,
SensorRestrictToMutants_RestrictToEmergentCells,
SensorRestrictToMutants_RestrictToZeroMutants,
SensorRestrictToMutants_RestrictToFreeCells,
SensorRestrictToMutants_RestrictToHandcraftedCells,
SensorRestrictToMutants_RestrictToLessComplexMutants,
SensorRestrictToMutants_RestrictToMoreComplexMutants,
SensorRestrictToMutants_Count
Expand Down Expand Up @@ -149,8 +149,8 @@ enum ReconnectorRestrictToMutants_
ReconnectorRestrictToMutants_NoRestriction,
ReconnectorRestrictToMutants_RestrictToSameMutants,
ReconnectorRestrictToMutants_RestrictToOtherMutants,
ReconnectorRestrictToMutants_RestrictToRespawnedMutants,
ReconnectorRestrictToMutants_RestrictToZeroMutants,
ReconnectorRestrictToMutants_RestrictToFreeCells,
ReconnectorRestrictToMutants_RestrictToHandcraftedCells,
ReconnectorRestrictToMutants_RestrictToLessComplexMutants,
ReconnectorRestrictToMutants_RestrictToMoreComplexMutants,
ReconnectorRestrictToMutants_Count
Expand Down
4 changes: 2 additions & 2 deletions source/EngineInterface/SerializerService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ namespace cereal
}
if (auxiliaries.contains(Id_SensorGenome_RestrictToOtherMutants_Deprecated)) {
auto restrictToOtherMutants = std::get<bool>(auxiliaries.at(Id_SensorGenome_RestrictToOtherMutants_Deprecated));
data.restrictToMutants = restrictToOtherMutants ? SensorRestrictToMutants_RestrictToEmergentCells : SensorRestrictToMutants_NoRestriction;
data.restrictToMutants = restrictToOtherMutants ? SensorRestrictToMutants_RestrictToFreeCells : SensorRestrictToMutants_NoRestriction;
}
}
//<<<
Expand Down Expand Up @@ -666,7 +666,7 @@ namespace cereal
}
if (auxiliaries.contains(Id_Sensor_RestrictToOtherMutants_Deprecated)) {
auto restrictToOtherMutants = std::get<bool>(auxiliaries.at(Id_Sensor_RestrictToOtherMutants_Deprecated));
data.restrictToMutants = restrictToOtherMutants ? SensorRestrictToMutants_RestrictToEmergentCells : SensorRestrictToMutants_NoRestriction;
data.restrictToMutants = restrictToOtherMutants ? SensorRestrictToMutants_RestrictToFreeCells : SensorRestrictToMutants_NoRestriction;
}
}
//<<<
Expand Down
2 changes: 1 addition & 1 deletion source/EngineTests/ConstructorTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ TEST_F(ConstructorTests, constructMuscleCell)

TEST_F(ConstructorTests, constructSensorCell)
{
auto sensorDesc = SensorGenomeDescription().setFixedAngle(90.0f).setColor(2).setMinDensity(0.5f).setRestrictToMutants(SensorRestrictToMutants_RestrictToEmergentCells);
auto sensorDesc = SensorGenomeDescription().setFixedAngle(90.0f).setColor(2).setMinDensity(0.5f).setRestrictToMutants(SensorRestrictToMutants_RestrictToFreeCells);
auto genome = GenomeDescriptionService::convertDescriptionToBytes(GenomeDescription().setCells({CellGenomeDescription().setCellFunction(sensorDesc)}));

DataDescription data;
Expand Down
8 changes: 4 additions & 4 deletions source/EngineTests/ReconnectorTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ TEST_F(ReconnectorTests, establishConnection_restrictToZeroMutants_success)
.setMaxConnections(2)
.setExecutionOrderNumber(0)
.setInputExecutionOrderNumber(5)
.setCellFunction(ReconnectorDescription().setRestrictToMutants(ReconnectorRestrictToMutants_RestrictToZeroMutants)),
.setCellFunction(ReconnectorDescription().setRestrictToMutants(ReconnectorRestrictToMutants_RestrictToHandcraftedCells)),
CellDescription()
.setId(2)
.setPos({11.0f, 10.0f})
Expand Down Expand Up @@ -451,7 +451,7 @@ TEST_F(ReconnectorTests, establishConnection_restrictToZeroMutants_failed)
.setMaxConnections(2)
.setExecutionOrderNumber(0)
.setInputExecutionOrderNumber(5)
.setCellFunction(ReconnectorDescription().setRestrictToMutants(ReconnectorRestrictToMutants_RestrictToZeroMutants)),
.setCellFunction(ReconnectorDescription().setRestrictToMutants(ReconnectorRestrictToMutants_RestrictToHandcraftedCells)),
CellDescription()
.setId(2)
.setPos({11.0f, 10.0f})
Expand Down Expand Up @@ -488,7 +488,7 @@ TEST_F(ReconnectorTests, establishConnection_restrictToRespawned_success)
.setMaxConnections(2)
.setExecutionOrderNumber(0)
.setInputExecutionOrderNumber(5)
.setCellFunction(ReconnectorDescription().setRestrictToMutants(ReconnectorRestrictToMutants_RestrictToRespawnedMutants)),
.setCellFunction(ReconnectorDescription().setRestrictToMutants(ReconnectorRestrictToMutants_RestrictToFreeCells)),
CellDescription()
.setId(2)
.setPos({11.0f, 10.0f})
Expand Down Expand Up @@ -527,7 +527,7 @@ TEST_F(ReconnectorTests, establishConnection_restrictToRespawned_failed)
.setMaxConnections(2)
.setExecutionOrderNumber(0)
.setInputExecutionOrderNumber(5)
.setCellFunction(ReconnectorDescription().setRestrictToMutants(ReconnectorRestrictToMutants_RestrictToRespawnedMutants)),
.setCellFunction(ReconnectorDescription().setRestrictToMutants(ReconnectorRestrictToMutants_RestrictToFreeCells)),
CellDescription()
.setId(2)
.setPos({11.0f, 10.0f})
Expand Down
8 changes: 4 additions & 4 deletions source/EngineTests/SensorTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ TEST_F(SensorTests, scanNeighborhood_targetedCreature_zeroMutant_found)
.setMaxConnections(2)
.setExecutionOrderNumber(0)
.setInputExecutionOrderNumber(5)
.setCellFunction(SensorDescription().setRestrictToMutants(SensorRestrictToMutants_RestrictToZeroMutants)),
.setCellFunction(SensorDescription().setRestrictToMutants(SensorRestrictToMutants_RestrictToHandcraftedCells)),
CellDescription()
.setId(2)
.setMutationId(6)
Expand Down Expand Up @@ -690,7 +690,7 @@ TEST_F(SensorTests, scanNeighborhood_targetedCreature_zeroMutant_notFound)
.setMaxConnections(2)
.setExecutionOrderNumber(0)
.setInputExecutionOrderNumber(5)
.setCellFunction(SensorDescription().setRestrictToMutants(SensorRestrictToMutants_RestrictToZeroMutants)),
.setCellFunction(SensorDescription().setRestrictToMutants(SensorRestrictToMutants_RestrictToHandcraftedCells)),
CellDescription()
.setId(2)
.setMutationId(6)
Expand Down Expand Up @@ -726,7 +726,7 @@ TEST_F(SensorTests, scanNeighborhood_targetedCreature_respawnedMutant_found)
.setMaxConnections(2)
.setExecutionOrderNumber(0)
.setInputExecutionOrderNumber(5)
.setCellFunction(SensorDescription().setRestrictToMutants(SensorRestrictToMutants_RestrictToEmergentCells)),
.setCellFunction(SensorDescription().setRestrictToMutants(SensorRestrictToMutants_RestrictToFreeCells)),
CellDescription()
.setId(2)
.setMutationId(6)
Expand Down Expand Up @@ -762,7 +762,7 @@ TEST_F(SensorTests, scanNeighborhood_targetedCreature_respawnedMutant_notFound)
.setMaxConnections(2)
.setExecutionOrderNumber(0)
.setInputExecutionOrderNumber(5)
.setCellFunction(SensorDescription().setRestrictToMutants(SensorRestrictToMutants_RestrictToEmergentCells)),
.setCellFunction(SensorDescription().setRestrictToMutants(SensorRestrictToMutants_RestrictToFreeCells)),
CellDescription()
.setId(2)
.setMutationId(6)
Expand Down
4 changes: 2 additions & 2 deletions source/Gui/GenomeEditorWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ void _GenomeEditorWindow::processNode(
AlienImGui::Combo(
AlienImGui::ComboParameters()
.name("Scan mutants")
.values({"None", "Same mutants", "Other mutants", "Free cells", "Handcrafted constructs", "Less complex mutants", "More complex mutants"})
.values({"None", "Same mutants", "Other mutants", "Free cells", "Handcrafted cells", "Less complex mutants", "More complex mutants"})
.textWidth(ContentTextWidth)
.tooltip(Const::SensorRestrictToMutantsTooltip),
sensor.restrictToMutants);
Expand Down Expand Up @@ -749,7 +749,7 @@ void _GenomeEditorWindow::processNode(
AlienImGui::Combo(
AlienImGui::ComboParameters()
.name("Restrict to mutants")
.values({"None", "Same mutants", "Other mutants", "Free cells", "Handcrafted constructs", "Less complex mutants", "More complex mutants"})
.values({"None", "Same mutants", "Other mutants", "Free cells", "Handcrafted cells", "Less complex mutants", "More complex mutants"})
.textWidth(ContentTextWidth)
.tooltip(Const::ReconnectorRestrictToMutantsTooltip),
reconnector.restrictToMutants);
Expand Down
4 changes: 2 additions & 2 deletions source/Gui/InspectorWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ void _InspectorWindow::processSensorContent(SensorDescription& sensor)
AlienImGui::Combo(
AlienImGui::ComboParameters()
.name("Scan mutants")
.values({"None", "Same mutants", "Other mutants", "Free cells", "Handcrafted constructs", "Less complex mutants", "More complex mutants"})
.values({"None", "Same mutants", "Other mutants", "Free cells", "Handcrafted cells", "Less complex mutants", "More complex mutants"})
.textWidth(CellFunctionTextWidth)
.tooltip(Const::SensorRestrictToMutantsTooltip),
sensor.restrictToMutants);
Expand Down Expand Up @@ -713,7 +713,7 @@ void _InspectorWindow::processReconnectorContent(ReconnectorDescription& reconne
AlienImGui::Combo(
AlienImGui::ComboParameters()
.name("Restrict to mutants")
.values({"None", "Same mutants", "Other mutants", "Free cells", "Handcrafted constructs", "Less complex mutants", "More complex mutants"})
.values({"None", "Same mutants", "Other mutants", "Free cells", "Handcrafted cells", "Less complex mutants", "More complex mutants"})
.textWidth(CellFunctionTextWidth)
.tooltip(Const::ReconnectorRestrictToMutantsTooltip),
reconnector.restrictToMutants);
Expand Down

0 comments on commit 73db528

Please sign in to comment.