12 #include <tracking/trackFindingVXD/algorithms/TrackerAlgorithmBase.h>
22 template<
class ContainerType,
class Val
idatorType>
23 class CellularAutomaton final :
public TrackerAlgorithmBase<ContainerType, ValidatorType> {
26 using BaseClass = TrackerAlgorithmBase<ContainerType, ValidatorType>;
38 int apply(ContainerType& aNetworkContainer)
override final
45 unsigned int activeCells = 1,
52 while (activeCells != 0 and caRound <
stopInRound) {
57 for (
auto* aNode : aNetworkContainer) {
58 auto& currentCell = aNode->getMetaInfo();
59 if (currentCell.isActivated() ==
false) {
continue; }
62 for (
auto* aNeighbour : aNode->getInnerNodes()) {
66 if (currentCell != aNeighbour->getMetaInfo())
continue;
70 if (goodNeighbours != 0) {
71 currentCell.setStateUpgrade(
true);
82 for (
auto* aNode : aNetworkContainer) {
83 auto& currentCell = aNode->getMetaInfo();
84 if (currentCell.isActivated() ==
false or currentCell.isUpgradeAllowed() ==
false) {
continue; }
86 currentCell.setStateUpgrade(
false);
87 currentCell.increaseState();
88 if (currentCell.getState() > highestCellState) { highestCellState = currentCell.getState(); }
106 unsigned int findSeeds(ContainerType& aNetworkContainer,
bool strictSeeding =
false) override final
108 unsigned int nSeeds = 0;
109 for (
auto* aNode : aNetworkContainer) {
110 if (strictSeeding && !(aNode->getOuterNodes().empty()))
continue;
113 aNode->getMetaInfo().setSeed(
true);