Settings
ConfigurationManager holds a model's settings: numbers with limits, presets, and a JSON form you can save and load. It does not build a simulation from them.
That is the part to be clear about. The settings are a checked bag of values (how many agents to start with, the width of the space, whether trails are drawn). Your code reads them and builds the model. Nothing in the library turns a settings file into agents.
import { ConfigurationManager } from '@prayas_abhinav/agentjs-core';
const config = new ConfigurationManager();
config.on('config:validation-error', (message) => console.log('refused:', message));
config.setParameter('agents.initialCount', 80); // true: it is a number from 1 to 1000
config.setParameter('agents.initialCount', 5000); // false: out of range, and 'config:validation-error' is emitted
config.updateConfig({ environment: { width: 1000 } }); // merge a partial configuration
console.log(config.getParameter('agents.initialCount'), config.getParameter('environment.width'));
console.log(config.getAvailablePresets()); // [ 'educational', 'performance', 'research' ]
config.loadPreset('research');
const saved = config.exportConfig('json'); // a JSON string
const again = new ConfigurationManager();
again.importConfig(saved, 'json'); // true when the string is valid
console.log(again.getParameter('agents.initialCount') === config.getParameter('agents.initialCount'));
What it provides
getConfig(),updateConfig(partial): the whole configuration, and a merge into it. Sections aresimulation,agents,environment,network,visualization,dataCollectionandexport.setParameter('agents.initialCount', 80)andgetParameter(key): one value by its dotted path. A value outside a known parameter's range is refused (the call returnsfalseandconfig:validation-erroris emitted). An unknown path is accepted as a custom parameter.getParameterDefinition(key),getParametersByCategory(),getSchema(): the name, type, range and description of each known parameter, for building a settings panel.loadPreset(name),savePreset(name),getAvailablePresets(): the presets areeducational,performanceandresearch.exportConfig('json' | 'yaml')andimportConfig(text, format).
NSMnum rows have their own JSON form, read by tableFromJSON; the README describes it.