Skip to content

Commit

Permalink
reconnector prechecks added
Browse files Browse the repository at this point in the history
  • Loading branch information
chrxh committed Oct 21, 2023
1 parent 93b1e4a commit 55ca126
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions source/EngineGpuKernels/ReconnectorProcessor.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,14 @@ ReconnectorProcessor::tryCreateConnection(SimulationData& data, SimulationStatis
SystemDoubleLock lock;
lock.init(&cell->locked, &closestCell->locked);
if (lock.tryLock()) {
closestCell->maxConnections = min(max(closestCell->maxConnections, closestCell->numConnections + 1), MAX_CELL_BONDS);
cell->maxConnections = min(max(cell->maxConnections, cell->numConnections + 1), MAX_CELL_BONDS);
CellConnectionProcessor::scheduleAddConnectionPair(data, cell, closestCell);
if (cell->numConnections < MAX_CELL_BONDS && closestCell->numConnections < MAX_CELL_BONDS) {
closestCell->maxConnections = min(max(closestCell->maxConnections, closestCell->numConnections + 1), MAX_CELL_BONDS);
cell->maxConnections = min(max(cell->maxConnections, cell->numConnections + 1), MAX_CELL_BONDS);
CellConnectionProcessor::scheduleAddConnectionPair(data, cell, closestCell);
activity.channels[0] = 1;
statistics.incNumReconnectorCreated(cell->color);
}
lock.releaseLock();
activity.channels[0] = 1;
statistics.incNumReconnectorCreated(cell->color);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/EngineInterface/SimulationParametersSpotValues.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct SimulationParametersSpotValues
ColorVector<float> radiationCellAgeStrength = {0.00002f, 0.00002f, 0.00002f, 0.00002f, 0.00002f, 0.00002f, 0.00002f};
float cellMaxForce = 0.8f;
ColorVector<float> cellMinEnergy = {50.0f, 50.0f, 50.0f, 50.0f, 50.0f, 50.0f, 50.0f};
float cellFusionVelocity = 0.4f;
float cellFusionVelocity = 0.6f;
float cellMaxBindingEnergy = Infinity<float>::value;
ColorVector<int> cellColorTransitionDuration = {
Infinity<int>::value,
Expand Down

0 comments on commit 55ca126

Please sign in to comment.