Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
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.
Instances
coreNodeIdNeighbors ∷ HasCallStack ⇒ NodeTopology → CoreNodeId → [CoreNodeId] Source #
The neighbors of this node
edgesNodeTopology ∷ NodeTopology → [(CoreNodeId, CoreNodeId)] Source #
The edges in this topology
∷ HasCallStack | |
⇒ NumCoreNodes | PRECONDITION: non-negative |
→ Gen NodeTopology |
Generate a NodeTopology
consistent with the given properties
∷ 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