UNPKG

simscript

Version:

A Discrete Event Simulation Library in TypeScript

38 lines (37 loc) 955 B
import { IPoint } from './util'; import { Queue } from './queue'; export interface INode { id?: string; position?: IPoint; queue?: Queue; } export interface ILink { id?: string; from: INode; to: INode; distance?: number; disabled?: boolean; queue?: Queue; } interface PathPart { id?: string; node: INode; link: ILink; distance: number; } export declare class Network { _nodes: INode[]; _links: ILink[]; constructor(options?: any); set nodes(value: INode[]); get nodes(): INode[]; set links(value: ILink[]); get links(): ILink[]; getNode(id: any): INode; shortestPath(start: INode, finish: INode): ILink[]; getLinkDistance(link: ILink, prevLink?: ILink): number; mergePath(path: ILink[]): [Queue[], number]; _getLinkAngle(link: ILink): number; _getPathPart(visited: PathPart[], node: INode): PathPart; } export {};