UNPKG

agentscape

Version:

Agentscape is a library for creating agent-based simulations. It provides a simple API for defining agents and their behavior, and for defining the environment in which the agents interact. Agentscape is designed to be flexible and extensible, allowing

43 lines (42 loc) 1.24 kB
export declare class LinkedListNode<T> { value: T; next: LinkedListNode<T> | undefined; previous: LinkedListNode<T> | undefined; constructor(value: T, next?: LinkedListNode<T> | undefined, previous?: LinkedListNode<T> | undefined); } export default class LinkedList<T> { head: LinkedListNode<T> | undefined; tail: LinkedListNode<T> | undefined; size: number; constructor(); /** * Iterates over the elements of the list */ [Symbol.iterator](): Generator<LinkedListNode<T>, void, unknown>; forEach(callback: (value: LinkedListNode<T>) => void): void; /** * Inserts an element at the end of the list * @param value */ append(value: T): void; /** * Inserts an element at the start of the list * @param value */ prepend(value: T): void; /** * Removes the first element from the list */ dropFirst(): void; /** * Removes the last element from the list */ dropLast(): void; /** * Inserts an element at a specific location in the list */ insertAt(index: number, value: T): void; find(value: T): LinkedListNode<T>; toArray(): T[]; static fromArray<T>(array: T[]): LinkedList<T>; }