• The simplest way to construct production polynomials from a graph of your unit production.

    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}]

    ...here's how to get your polynomials:

    const polynomials: ReadonlyMap<string, Polynomial<number>>
    = simpleGraphToPolynomials(vertices, edges)

    If you need a more flexible graph format, see also customGraphToPolynomials.

    Type Parameters

    • V

    • E extends {
          each: number;
          from: V;
          to: V;
      }

    Parameters

    • vertices: ReadonlyMap<V, number>
    • edges: readonly E[]

    Returns ReadonlyMap<V, Polynomial<number>>

  • Type Parameters

    • V

    • E extends {
          each: D;
          from: V;
          to: V;
      }

    • D

    Parameters

    Returns ReadonlyMap<V, Polynomial<D>>

Generated using TypeDoc