Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Test.ThreadNet.Util.NodeTopology
Contents
Synopsis
- newtype NodeTopology = NodeTopology {}
- coreNodeIdNeighbors ∷ HasCallStack ⇒ NodeTopology → CoreNodeId → [CoreNodeId]
- edgesNodeTopology ∷ NodeTopology → [(CoreNodeId, CoreNodeId)]
- genNodeTopology ∷ HasCallStack ⇒ NumCoreNodes → Gen NodeTopology
- mapNodeTopology ∷ (CoreNodeId → CoreNodeId) → NodeTopology → NodeTopology
- meshNodeTopology ∷ NumCoreNodes → NodeTopology
- minimumDegreeNodeTopology ∷ NodeTopology → Maybe Int
- shrinkNodeTopology ∷ NodeTopology → [NodeTopology]
- unionNodeTopology ∷ NodeTopology → NodeTopology → NodeTopology
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.
Constructors
NodeTopology | |
Fields |
Instances
Generic NodeTopology Source # | |
Defined in Test.ThreadNet.Util.NodeTopology Associated Types type Rep NodeTopology ∷ Type → Type # | |
Show NodeTopology Source # | |
Defined in Test.ThreadNet.Util.NodeTopology Methods showsPrec ∷ Int → NodeTopology → ShowS # show ∷ NodeTopology → String # showList ∷ [NodeTopology] → ShowS # | |
Eq NodeTopology Source # | |
Defined in Test.ThreadNet.Util.NodeTopology | |
Condense NodeTopology Source # | |
Defined in Test.ThreadNet.Util.NodeTopology Methods | |
type Rep NodeTopology Source # | |
Defined in Test.ThreadNet.Util.NodeTopology type Rep NodeTopology = D1 ('MetaData "NodeTopology" "Test.ThreadNet.Util.NodeTopology" "ouroboros-consensus-diffusion-0.19.0.0-inplace-unstable-diffusion-testlib" 'True) (C1 ('MetaCons "NodeTopology" 'PrefixI 'True) (S1 ('MetaSel ('Just "unNodeTopology") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map CoreNodeId (Set CoreNodeId))))) |
coreNodeIdNeighbors ∷ HasCallStack ⇒ NodeTopology → CoreNodeId → [CoreNodeId] Source #
The neighbors of this node
edgesNodeTopology ∷ NodeTopology → [(CoreNodeId, CoreNodeId)] Source #
The edges in this topology
Arguments
∷ HasCallStack | |
⇒ NumCoreNodes | PRECONDITION: non-negative |
→ Gen NodeTopology |
Generate a NodeTopology
consistent with the given properties
Arguments
∷ NumCoreNodes | PRECONDITION: non-negative |
→ NodeTopology |
Connect every pair of nodes
minimumDegreeNodeTopology ∷ NodeTopology → Maybe Int Source #
The neighbor count of the node with the fewest neighbors, unless there are zero nodes
shrinkNodeTopology ∷ NodeTopology → [NodeTopology] Source #
Shrink a node topology
The new topologies must be usable with the same number of nodes and slots as the old topology