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

30 lines (29 loc) 863 B
import type RandomGenerator from './RandomGenerator'; /** * A symbolic representation of an angle. It may be * manipulated in either degrees or radians. */ export default class Angle { private _angle; /** * Generates a random angle in the range [0, 2π). */ static random(rng: RandomGenerator): Angle; constructor(value: number, unit: 'deg' | 'rad'); /** * Sets the angle to a given value. The value will be wrapped to the range [0, 2π). */ set(value: number, unit: 'deg' | 'rad'): void; /** * Returns the angle in radians */ asRadians(): number; /** * Returns the angle in degrees */ asDegrees(): number; /** * Increments the angle by a given value. The angle will be wrapped to the range [0, 2π). */ increment(value: number, unit: 'deg' | 'rad'): void; }