This pair of functions describes how to turn your graph's vertices and edges into production numbers.
If your application has the following graph...
type Edge = {from: string, to: string, each: number}const vertices = new Map([['drone', 3], ['meat', 2]])const edges: readonly Edge[] = [{from: 'drone', to: 'meat', each: 5}] Copy
type Edge = {from: string, to: string, each: number}const vertices = new Map([['drone', 3], ['meat', 2]])const edges: readonly Edge[] = [{from: 'drone', to: 'meat', each: 5}]
...here's what you pass to production functions:
const getters: GetPoly<Edge, string, number> = { each: (edge: Edge) => edge.each, count: (vertex: string) => vertices.get(vertex),} Copy
const getters: GetPoly<Edge, string, number> = { each: (edge: Edge) => edge.each, count: (vertex: string) => vertices.get(vertex),}
Production graphs can be any shape you like, any format you like, as long as your GetPoly functions correctly describe how to count each node and how much each edge produces.
GetPoly
How many of this thing exist at t=0? null or undefined if no such vertex exists.
null
undefined
How many children does each parent produce per second?
Generated using TypeDoc
This pair of functions describes how to turn your graph's vertices and edges into production numbers.
If your application has the following graph...
...here's what you pass to production functions:
Production graphs can be any shape you like, any format you like, as long as your
GetPoly
functions correctly describe how to count each node and how much each edge produces.