Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
tpl_ca_stochastic_rules_test.cc File Reference

Phase 8 tests for tpl_ca_stochastic_rules.H. More...

#include <algorithm>
#include <array>
#include <cstdint>
#include <random>
#include <vector>
#include <gtest/gtest.h>
#include <ca-rng.H>
#include <ca-traits.H>
#include <tpl_ca_concepts.H>
#include <tpl_ca_engine.H>
#include <tpl_ca_lattice.H>
#include <tpl_ca_neighborhood.H>
#include <tpl_ca_parallel_engine.H>
#include <tpl_ca_rule.H>
#include <tpl_ca_stochastic_rules.H>
#include <tpl_ca_storage.H>
Include dependency graph for tpl_ca_stochastic_rules_test.cc:

Go to the source code of this file.

Functions

 TEST (CAProbabilisticRule, LegacyTwoArgFunctorStillWorks)
 
 TEST (CAProbabilisticRule, ContextualRouteUsesCellSeedDeterminism)
 
 TEST (CAApplyRule, ContextualOverloadIsPickedUp)
 
 TEST (CAApplyRule, FallsBackToLegacyWhenContextNotAccepted)
 
 TEST (CAForestFire, BurningAlwaysBecomesEmpty)
 
 TEST (CAForestFire, TreeIgnitesWhenAnyNeighbourBurns)
 
 TEST (CAForestFire, EmptyStaysEmptyWhenGrowthIsZero)
 
 TEST (CAForestFire, EmptyAlwaysGrowsWhenGrowthIsOne)
 
 TEST (CAForestFire, FireSpreadsOnSmallToroidalLattice)
 
 TEST (CASir, RecoveredStaysRecovered)
 
 TEST (CASir, SusceptibleStaysSWithoutInfectedNeighbours)
 
 TEST (CASir, InfectedAlwaysRecoversAtGammaOne)
 
 TEST (CASir, R0BelowOneExtinguishesEpidemic)
 
 TEST (CAIsingGlauber, FlipProbabilityOneHalfWhenDeltaEnergyZero)
 
 TEST (CAIsingMetropolis, AlwaysFlipsWhenEnergyDecreases)
 
 TEST (CAIsingMetropolis, NeverFlipsWhenEnergyMassivelyIncreases)
 
 TEST (CASchelling, IsolatedAgentStaysPut)
 
 TEST (CASchelling, UnhappyAgentVacates)
 
 TEST (CASchelling, HappyAgentStaysPut)
 
 TEST (CASchelling, EmptyCellFillsWithMajority)
 
 TEST (CAStochasticReproducibility, ForestFireIdenticalAcrossThreadCounts)
 
 TEST (CAStochasticReproducibility, SIRIdenticalAcrossThreadCounts)
 
 TEST (CAStochasticReproducibility, IsingGlauberIdenticalAcrossThreadCounts)
 
 TEST (CAStochasticReproducibility, SchellingIdenticalAcrossThreadCounts)
 
 TEST (CAStochasticReproducibility, SequentialAndParallelMatchForestFire)
 

Detailed Description

Phase 8 tests for tpl_ca_stochastic_rules.H.

Coverage:

  • Probabilistic_Rule legacy 2-arg and Phase 8 3-arg dispatch.
  • apply_rule chooses the contextual overload when available.
  • Forest fire, SIR, Ising and Schelling rules' canonical transitions on hand-crafted micro-frames.
  • Cross-thread bit-for-bit reproducibility on the parallel engine for every stochastic rule.
  • SIR with R0 < 1 extinguishes the epidemic.

Definition in file tpl_ca_stochastic_rules_test.cc.

Function Documentation

◆ TEST() [1/25]

TEST ( CAApplyRule  ,
ContextualOverloadIsPickedUp   
)

◆ TEST() [2/25]

TEST ( CAApplyRule  ,
FallsBackToLegacyWhenContextNotAccepted   
)

◆ TEST() [3/25]

TEST ( CAForestFire  ,
BurningAlwaysBecomesEmpty   
)

◆ TEST() [4/25]

TEST ( CAForestFire  ,
EmptyAlwaysGrowsWhenGrowthIsOne   
)

◆ TEST() [5/25]

TEST ( CAForestFire  ,
EmptyStaysEmptyWhenGrowthIsZero   
)

◆ TEST() [6/25]

TEST ( CAForestFire  ,
FireSpreadsOnSmallToroidalLattice   
)

◆ TEST() [7/25]

TEST ( CAForestFire  ,
TreeIgnitesWhenAnyNeighbourBurns   
)

◆ TEST() [8/25]

TEST ( CAIsingGlauber  ,
FlipProbabilityOneHalfWhenDeltaEnergyZero   
)

◆ TEST() [9/25]

TEST ( CAIsingMetropolis  ,
AlwaysFlipsWhenEnergyDecreases   
)

◆ TEST() [10/25]

TEST ( CAIsingMetropolis  ,
NeverFlipsWhenEnergyMassivelyIncreases   
)

◆ TEST() [11/25]

TEST ( CAProbabilisticRule  ,
ContextualRouteUsesCellSeedDeterminism   
)

◆ TEST() [12/25]

TEST ( CAProbabilisticRule  ,
LegacyTwoArgFunctorStillWorks   
)

◆ TEST() [13/25]

TEST ( CASchelling  ,
EmptyCellFillsWithMajority   
)

◆ TEST() [14/25]

TEST ( CASchelling  ,
HappyAgentStaysPut   
)

◆ TEST() [15/25]

TEST ( CASchelling  ,
IsolatedAgentStaysPut   
)

◆ TEST() [16/25]

TEST ( CASchelling  ,
UnhappyAgentVacates   
)

◆ TEST() [17/25]

TEST ( CASir  ,
InfectedAlwaysRecoversAtGammaOne   
)

◆ TEST() [18/25]

TEST ( CASir  ,
R0BelowOneExtinguishesEpidemic   
)

◆ TEST() [19/25]

TEST ( CASir  ,
RecoveredStaysRecovered   
)

◆ TEST() [20/25]

TEST ( CASir  ,
SusceptibleStaysSWithoutInfectedNeighbours   
)

◆ TEST() [21/25]

TEST ( CAStochasticReproducibility  ,
ForestFireIdenticalAcrossThreadCounts   
)

◆ TEST() [22/25]

TEST ( CAStochasticReproducibility  ,
IsingGlauberIdenticalAcrossThreadCounts   
)

◆ TEST() [23/25]

TEST ( CAStochasticReproducibility  ,
SchellingIdenticalAcrossThreadCounts   
)

◆ TEST() [24/25]

◆ TEST() [25/25]

TEST ( CAStochasticReproducibility  ,
SIRIdenticalAcrossThreadCounts   
)