Maps each Node to its balance.
Array of functions that setup constraints on the solver. Due to the nature of some of these constraints, they can't be applied until all the nodes exist, which is why they have to be batched up in functions.
Maps each Node to the Set of its consumers.
Constraint solver that does all the heavy lifting.
Maps each Node to the Set of its suppliers.
Maps a pair of Nodes to the amount transferred between them.
Turns a node into a consumable. The given node is modified in place and returned.
Registers and returns a balance for the given node.
Registers sets for the suppliers and consumers of the given node.
Registering a transfer between a consumable and a supplyable requires also registering the inverse transfer. This is tedious, so this function takes care of it.
Clears all nodes, relationships, and constraints, and resets the kiwi.js solver.
Resolves the balances and tranfers of the network.
Returns an Expression that represents the total value consumed by the given node's consumers.
Returns an Expression that represents the total value supplied by the given node's suppliers.
Turns a node into a supplyable. The given node is modified in place and returned.
Generated using TypeDoc
All nodes that are part of the network.