ouroboros-consensus-test-0.1.0.0: Tests of the consensus layer
Safe HaskellNone
LanguageHaskell2010

Test.ThreadNet.Util.NodeTopology

Synopsis

Node Topology

newtype NodeTopology Source #

Which lesser nodes each node connects to

INVARIANT: for each mapping n -> ms, n > m for each m in ms

INVARIANT: only the mapping for n = CoreNodeId 0 is empty

INVARIANT: there is a mapping for each CoreNodeId in the test, 0 .. n - 1

Note that every node is connected to every other but not necessarily directly. In other words, the topology is always a single network of nodes, which is realistic. With other test configuration components, such as network partitions, the network may split (temporarily or not) into separate connected components during the execution, but the base topology is connected.

Instances

Instances details
Eq NodeTopology Source # 
Instance details

Defined in Test.ThreadNet.Util.NodeTopology

Show NodeTopology Source # 
Instance details

Defined in Test.ThreadNet.Util.NodeTopology

Generic NodeTopology Source # 
Instance details

Defined in Test.ThreadNet.Util.NodeTopology

Associated Types

type Rep NodeTopologyTypeType Source #

Condense NodeTopology Source # 
Instance details

Defined in Test.ThreadNet.Util.NodeTopology

type Rep NodeTopology Source # 
Instance details

Defined in Test.ThreadNet.Util.NodeTopology

type Rep NodeTopology = D1 ('MetaData "NodeTopology" "Test.ThreadNet.Util.NodeTopology" "ouroboros-consensus-test-0.1.0.0-inplace" 'True) (C1 ('MetaCons "NodeTopology" 'PrefixI 'True) (S1 ('MetaSel ('Just "unNodeTopology") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map CoreNodeId (Set CoreNodeId)))))

coreNodeIdNeighborsHasCallStackNodeTopologyCoreNodeId → [CoreNodeId] Source #

The neighbors of this node

edgesNodeTopologyNodeTopology → [(CoreNodeId, CoreNodeId)] Source #

The edges in this topology

genNodeTopology Source #

Arguments

HasCallStack 
NumCoreNodes

PRECONDITION: non-negative

→ Gen NodeTopology 

Generate a NodeTopology consistent with the given properties

meshNodeTopology Source #

Arguments

NumCoreNodes

PRECONDITION: non-negative

NodeTopology 

Connect every pair of nodes

minimumDegreeNodeTopologyNodeTopologyMaybe Int Source #

The neighbor count of the node with the fewest neighbors, unless there are zero nodes

shrinkNodeTopologyNodeTopology → [NodeTopology] Source #

Shrink a node topology

The new topologies must be usable with the same number of nodes and slots as the old topology