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

Tests for Aleph::CA::Graph_Lattice and Graph_Synchronous_Engine. More...

#include <cstdint>
#include <random>
#include <stdexcept>
#include <vector>
#include <gtest/gtest.h>
#include <ca-traits.H>
#include <tpl_ca_concepts.H>
#include <tpl_ca_graph_automaton.H>
#include <tpl_ca_rule.H>
Include dependency graph for tpl_ca_graph_automaton_test.cc:

Go to the source code of this file.

Functions

 TEST (CAGraphBuilders, PathGraphAdjacencyShape)
 
 TEST (CAGraphBuilders, RingGraphAdjacencyShape)
 
 TEST (CAGraphBuilders, GridGraphAdjacencyEdgeCount)
 
 TEST (CAGraphBuilders, ToroidalGridAlwaysHasFourNeighbours)
 
 TEST (CAGraphLattice, ConstructorRejectsOutOfRangeNeighbour)
 
 TEST (CAGraphLattice, AtAndSetRoundTrip)
 
 TEST (CAGraphLattice, AtSafeOnOutOfRangeReturnsDefault)
 
 TEST (CAGraphLattice, FillResetsEveryCell)
 
 TEST (CAGraphEngine, MajorityRulePreservesAllZero)
 
 TEST (CAGraphEngine, MajorityRulePreservesAllOnes)
 
 TEST (CAGraphEngine, MajorityFlipsIsolatedSeedBackToZero)
 
 TEST (CAGraphEngine, VoterModelConvergesOnConnectedNonBipartiteGraph)
 
 TEST (CAGraphEngine, HookFiringSemantics)
 
 TEST (CAGraphEngine, EquivalenceWithSequentialEngineOnGrid)
 

Detailed Description

Tests for Aleph::CA::Graph_Lattice and Graph_Synchronous_Engine.

Scope:

  • LatticeLike conformance + degree / max_degree / neighbours.
  • Constructor validates neighbour ids.
  • Path graph and grid graph helpers produce expected adjacency.
  • Simple totalistic rule on a path graph evolves as expected.
  • Voter model on a connected ring converges to consensus with a fixed seed, in agreement with theoretical guarantees.
  • Hooks fire as expected.
  • Strict access throws on out-of-range ids; at_safe returns 0.

Definition in file tpl_ca_graph_automaton_test.cc.

Function Documentation

◆ TEST() [1/14]

TEST ( CAGraphBuilders  ,
GridGraphAdjacencyEdgeCount   
)

◆ TEST() [2/14]

TEST ( CAGraphBuilders  ,
PathGraphAdjacencyShape   
)

◆ TEST() [3/14]

TEST ( CAGraphBuilders  ,
RingGraphAdjacencyShape   
)

◆ TEST() [4/14]

TEST ( CAGraphBuilders  ,
ToroidalGridAlwaysHasFourNeighbours   
)

◆ TEST() [5/14]

◆ TEST() [6/14]

◆ TEST() [7/14]

◆ TEST() [8/14]

◆ TEST() [9/14]

◆ TEST() [10/14]

TEST ( CAGraphEngine  ,
VoterModelConvergesOnConnectedNonBipartiteGraph   
)

◆ TEST() [11/14]

TEST ( CAGraphLattice  ,
AtAndSetRoundTrip   
)

◆ TEST() [12/14]

TEST ( CAGraphLattice  ,
AtSafeOnOutOfRangeReturnsDefault   
)

◆ TEST() [13/14]

TEST ( CAGraphLattice  ,
ConstructorRejectsOutOfRangeNeighbour   
)

◆ TEST() [14/14]

TEST ( CAGraphLattice  ,
FillResetsEveryCell   
)