agentjs-core
Version:
A comprehensive agent-based modeling framework with built-in p5.js visualization
71 lines • 2.05 kB
TypeScript
/**
* BaseAgent - Minimal agent implementation for basic use cases
*/
import { Agent } from './Agent';
import type { AgentId, Position, AgentProperties } from '../../types/core';
/**
* BaseAgent - Minimal agent with basic functionality
*
* Features:
* - Position management with simple movement
* - Property management through base class
* - Lifecycle management
* - No specialized behaviors
*
* Educational Context: Represents basic community members
* who participate in the environment but don't have complex
* movement patterns or network relationships.
*/
export declare class BaseAgent extends Agent {
constructor(id?: string | AgentId, initialProperties?: AgentProperties, initialPosition?: Position);
/**
* Basic step implementation - override for custom behavior
* By default, does nothing (static agent)
*/
step(): void;
/**
* Simple position update with validation
*/
moveTo(newPosition: Position): void;
/**
* Move relative to current position
*/
moveBy(dx: number, dy: number): void;
/**
* Set agent energy level (common property)
*/
setEnergy(energy: number): void;
/**
* Get agent energy level
*/
getEnergy(): number;
/**
* Set agent activity level (0-1)
*/
setActivity(activity: number): void;
/**
* Get agent activity level
*/
getActivity(): number;
/**
* Check if agent is at a specific position
*/
isAt(position: Position): boolean;
/**
* Calculate distance to another position
*/
distanceTo(position: Position): number;
/**
* Calculate distance to another agent
*/
distanceToAgent(other: Agent): number;
/**
* Check if agent is within a certain distance of a position
*/
isNear(position: Position, radius: number): boolean;
/**
* Check if agent is within a certain distance of another agent
*/
isNearAgent(other: Agent, radius: number): boolean;
}
//# sourceMappingURL=BaseAgent.d.ts.map