import { Connection } from "./connection" import { Connection as ConnectionMethod } from "../methods/connection" import { Gating } from "../methods/gating" import { Node, NodeVal } from "./node" import * as neataptic from "neataptic" export type GroupConnections = { in: Connection[], out: Connection[], self: Connection[], } export interface Group { nodes: Node[] connections: GroupConnections activate: (vals: number[]) => number[] propagate: (rate: number, momentum: number, target: number[]) => void connect: (target: Group, method: ConnectionMethod) => Connection[] gate: (connections: Connection[], method: Gating) => void set: (val: NodeVal) => void disconnect: (target: Node|Group, twosided: boolean) => void clear: () => void } export function create(size: number): Group { return new neataptic.Group(size) } export const classConstructor: (size: number) => void = neataptic.Group