agentjs-core
Version:
A comprehensive agent-based modeling framework with built-in p5.js visualization
96 lines • 2.58 kB
TypeScript
import { MLBehaviorModel, ModelLoadConfig, MLPerformanceMetrics } from './interfaces';
/**
* Central registry for managing ML models in the AgentJS framework
*/
export declare class ModelRegistry {
private static instance;
private models;
private modelConfigs;
private loadingPromises;
private performanceMetrics;
private constructor();
/**
* Get singleton instance
*/
static getInstance(): ModelRegistry;
/**
* Initialize TensorFlow.js with optimal backend
*/
private initializeTensorFlow;
/**
* Register a model in the registry
* @param name Unique name for the model
* @param modelPath Path to the model file
* @param config Optional configuration
*/
registerModel(name: string, modelPath: string, config?: Partial<ModelLoadConfig>): Promise<void>;
/**
* Load a model from path
*/
private loadModel;
/**
* Get a registered model
* @param name Model name
* @returns Model instance or undefined
*/
getModel(name: string): MLBehaviorModel | undefined;
/**
* Check if a model is registered
* @param name Model name
* @returns True if model exists
*/
hasModel(name: string): boolean;
/**
* List all registered model names
* @returns Array of model names
*/
listModelNames(): string[];
/**
* Get model configuration
* @param name Model name
* @returns Model configuration or undefined
*/
getModelConfig(name: string): ModelLoadConfig | undefined;
/**
* Get model performance metrics
* @param name Model name
* @returns Performance metrics or undefined
*/
getModelMetrics(name: string): MLPerformanceMetrics | undefined;
/**
* Update performance metrics for a model
*/
updateModelMetrics(name: string, update: Partial<MLPerformanceMetrics>): void;
/**
* Remove a model from the registry
* @param name Model name
*/
removeModel(name: string): boolean;
/**
* Clear all models
*/
clearAll(): void;
/**
* Validate a loaded TensorFlow model
*/
private validateModel;
/**
* Get memory usage information
*/
getMemoryInfo(): {
numTensors: number;
numBytes: number;
};
/**
* Clean up unused tensors
*/
cleanupMemory(): void;
/**
* Get TensorFlow.js backend information
*/
getBackendInfo(): {
backend: string;
ready: boolean;
};
}
//# sourceMappingURL=ModelRegistry.d.ts.map