10#include <tracking/trackFindingVXD/algorithms/TrackerAlgorithmBase.h>
20 template<
class ContainerType,
class Val
idatorType>
36 int apply(ContainerType& aNetworkContainer)
override final
43 unsigned int activeCells = 1,
49 while (activeCells != 0 and caRound <
stopInRound) {
54 for (
auto* aNode : aNetworkContainer) {
55 auto& currentCell = aNode->getMetaInfo();
56 if (currentCell.isActivated() ==
false) {
continue; }
59 for (
auto* aNeighbour : aNode->getInnerNodes()) {
63 if (currentCell != aNeighbour->getMetaInfo())
continue;
67 if (goodNeighbours != 0) {
68 currentCell.setStateUpgrade(
true);
74 for (
auto* aNode : aNetworkContainer) {
75 auto& currentCell = aNode->getMetaInfo();
76 if (currentCell.isActivated() ==
false or currentCell.isUpgradeAllowed() ==
false) {
continue; }
78 currentCell.setStateUpgrade(
false);
79 currentCell.increaseState();
80 if (currentCell.getState() > highestCellState) { highestCellState = currentCell.getState(); }
98 unsigned int findSeeds(ContainerType& aNetworkContainer,
bool strictSeeding =
false) override final
100 unsigned int nSeeds = 0;
101 for (
auto* aNode : aNetworkContainer) {
102 if (strictSeeding && !(aNode->getOuterNodes().empty()))
continue;
105 aNode->getMetaInfo().setSeed(
true);
The CellularAutomaton class This class serves as a functor for the algorithm itself.
CellularAutomaton()
constructor
unsigned int stopInRound
aborts CA after stopInRound iterations - mainly for debugging purposes:
int apply(ContainerType &aNetworkContainer) override final
actual algorithm of Cellular Automaton, returns number of rounds needed to finish or -1 if CA was abo...
unsigned int findSeeds(ContainerType &aNetworkContainer, bool strictSeeding=false) override final
checks network given for seeds, returns number of seeds found (if strictSeeding is set to true,...
base class for TrackerAlgorithms. shall allow a common base for algorithms like the cellular automato...
ValidatorType m_validator
something which checks the quality of the test so far (will be applied by the apply-function
Abstract base class for different kinds of events.