Utility functions included with Emergent for building simulations quickly.
These top-level functions are included as reference implementations and starting points. They are not required — you can always write your own initial data and timestep functions.
from emergent.main import genInitialData, genTimestepData
genInitialData(model)
Generates initial data for a single node. Returns a dictionary with a random integer id between 1 and 100.Args:
model (AgentModel) — The model instance.
Returns:dict
{"id": <random int 1–100>}
Example:
from emergent import AgentModelfrom emergent.main import genInitialDatamodel = AgentModel()model.set_initial_data_function(genInitialData)
genTimestepData(model, nodeData)
Generates updated data for a single node by incrementing its id by 1.Args:
model (AgentModel) — The model instance.
nodeData (dict) — The node’s current data dictionary.
Returns:dict — The same nodeData dict with id incremented.
# Before: {"id": 42}# After: {"id": 43}
genTimestepData is a per-node function. To use it in a simulation, wrap it in a timestep function that iterates over the graph’s nodes.
Example:
from emergent.main import genTimestepDatadef my_timestep(model): graph = model.get_graph() for node in graph.nodes(): updated = genTimestepData(model, graph.nodes[node]) graph.nodes[node].update(updated)model.set_timestep_function(my_timestep)
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Emergent","colors":{"primary":"#00d4aa","light":"#33ddb8","dark":"#00bf99"},"logo":{"light":"https://mintcdn.com/delphilos/rVXzFuNLnppv4bEG/logo.svg?fit=max\u0026auto=format\u0026n=rVXzFuNLnppv4bEG\u0026q=85\u0026s=a0ec14e4366bf195112a2877725f257e","dark":"https://mintcdn.com/delphilos/rVXzFuNLnppv4bEG/logo-dark.svg?fit=max\u0026auto=format\u0026n=rVXzFuNLnppv4bEG\u0026q=85\u0026s=cb9e239836936ff5c2a04a680a909424"},"favicon":"/favicon.svg","styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"delphilos","hasAudioNarration":false,"actualSubdomain":"delphilos","customDomains":["docs.emergent.community"],"gitSource":{"type":"github","owner":"delphilos","repo":"emergent","deployBranch":"kekoawong/deploy-pypi","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6ae94a91a79c9948d245632b:success","clientVersion":"0.0.4167","searchFilterCounts":[{"language":"default","tag":"Documentation","count":5},{"language":"default","tag":"API Reference","count":2},{"language":"default","tag":"emergent","count":2},{"language":"default","tag":"Core Concepts","count":2},{"language":"default","tag":"Get Started","count":2},{"language":"default","tag":"Examples","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/helpers","slug":"/api-reference/helpers","pageMetadata":{"title":"Helper Functions","description":"Utility functions included with Emergent for building simulations quickly.","href":"/api-reference/helpers"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Utility functions included with Emergent for building simulations quickly.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,hr:`hr`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`These top-level functions are included as reference implementations and starting points. They are not required — you can always write your own initial data and timestep functions.`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` emergent.main `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` genInitialData, genTimestepData`})]}),`\n`]})})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`geninitialdata-model`,children:_jsx(_components.code,{children:`genInitialData(model)`})}),`\n`,_jsxs(_components.p,{children:[`Generates initial data for a single node. Returns a dictionary with a random integer `,_jsx(_components.code,{children:`id`}),` between 1 and 100.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Args:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model`}),` (`,_jsx(_components.code,{children:`AgentModel`}),`) — The model instance.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Returns:`}),` `,_jsx(_components.code,{children:`dict`})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: \u003crandom int 1–100>}`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Example:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` emergent `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` AgentModel`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` emergent.main `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` genInitialData`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`model = AgentModel()`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`model.set_initial_data_function(genInitialData)`})}),`\n`]})})}),`\n`,_jsx(_components.hr,{}),`\n`,_jsx(Heading,{level:`2`,id:`gentimestepdata-model-nodedata`,children:_jsx(_components.code,{children:`genTimestepData(model, nodeData)`})}),`\n`,_jsxs(_components.p,{children:[`Generates updated data for a single node by incrementing its `,_jsx(_components.code,{children:`id`}),` by 1.`]}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Args:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`model`}),` (`,_jsx(_components.code,{children:`AgentModel`}),`) — The model instance.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`nodeData`}),` (`,_jsx(_components.code,{children:`dict`}),`) — The node’s current data dictionary.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Returns:`}),` `,_jsx(_components.code,{children:`dict`}),` — The same `,_jsx(_components.code,{children:`nodeData`}),` dict with `,_jsx(_components.code,{children:`id`}),` incremented.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Before: {\"id\": 42}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# After: {\"id\": 43}`})}),`\n`]})})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`genTimestepData`}),` is a `,_jsx(_components.strong,{children:`per-node`}),` function. To use it in a simulation, wrap it in a timestep function that iterates over the graph’s nodes.`]})}),`\n`,_jsx(_components.p,{children:_jsx(_components.strong,{children:`Example:`})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`9`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`9`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`from`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` emergent.main `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` genTimestepData`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`def`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` my_timestep(model):`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` graph = model.get_graph()`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` for`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` node `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`in`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` graph.nodes():`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` updated = genTimestepData(model, graph.nodes[node])`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` graph.nodes[node].update(updated)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`model.set_timestep_function(my_timestep)`})}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Helper Functions","description":"Utility functions included with Emergent for building simulations quickly.","href":"/api-reference/helpers"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"genInitialData(model)","slug":"geninitialdata-model","depth":2,"children":[]},{"title":"genTimestepData(model, nodeData)","slug":"gentimestepdata-model-nodedata","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"delphilos","siteName":"Emergent","title":"Helper Functions - Emergent","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-03-21T23:16:33.611Z","originalFileLocation":"api-reference/helpers.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Utility functions included with Emergent for building simulations quickly.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Emergent\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/delphilos/8NwdPIgzSWR2pCYD/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/delphilos/8NwdPIgzSWR2pCYD/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/delphilos/8NwdPIgzSWR2pCYD/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/delphilos/8NwdPIgzSWR2pCYD/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/delphilos/8NwdPIgzSWR2pCYD/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/delphilos/8NwdPIgzSWR2pCYD/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/delphilos/8NwdPIgzSWR2pCYD/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/delphilos/8NwdPIgzSWR2pCYD/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/delphilos/8NwdPIgzSWR2pCYD/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Helper Functions - Emergent\">\u003cmeta data-mint-head property=\"og:description\" content=\"Utility functions included with Emergent for building simulations quickly.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Emergent\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.emergent.community/api-reference/helpers\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://delphilos.mintlify.site/_mintlify/api/og/v2?division=emergent\u0026amp;title=Helper+Functions\u0026amp;description=Utility+functions+included+with+Emergent+for+building+simulations+quickly.\u0026amp;theme=faba350105ca0cc435ec304a\u0026amp;signature=545b1e720107230f2bd6e545063d5c81a20271dc8a749c2fa32345b9044ea544\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Helper Functions - Emergent\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Utility functions included with Emergent for building simulations quickly.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://delphilos.mintlify.site/_mintlify/api/og/v2?division=emergent\u0026amp;title=Helper+Functions\u0026amp;description=Utility+functions+included+with+Emergent+for+building+simulations+quickly.\u0026amp;theme=faba350105ca0cc435ec304a\u0026amp;signature=545b1e720107230f2bd6e545063d5c81a20271dc8a749c2fa32345b9044ea544\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/delphilos/8NwdPIgzSWR2pCYD/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Emergent\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#00d4aa\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.emergent.community/api-reference/helpers\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/helpers.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.emergent.community/#organization\",\"name\":\"Emergent\",\"url\":\"https://docs.emergent.community\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/delphilos/rVXzFuNLnppv4bEG/logo.svg?fit=max\u0026auto=format\u0026n=rVXzFuNLnppv4bEG\u0026q=85\u0026s=a0ec14e4366bf195112a2877725f257e\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.emergent.community#website\",\"name\":\"Emergent\",\"url\":\"https://docs.emergent.community\",\"publisher\":{\"@id\":\"https://docs.emergent.community/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.emergent.community/api-reference/helpers#webpage\",\"url\":\"https://docs.emergent.community/api-reference/helpers\",\"name\":\"Helper Functions\",\"description\":\"Utility functions included with Emergent for building simulations quickly.\",\"dateModified\":\"2026-03-21T23:16:33.611Z\",\"isPartOf\":{\"@id\":\"https://docs.emergent.community#website\"},\"breadcrumb\":{\"@id\":\"https://docs.emergent.community/api-reference/helpers#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.emergent.community/api-reference/helpers#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"emergent\",\"item\":\"https://docs.emergent.community/api-reference/agent-model\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Helper Functions\",\"item\":\"https://docs.emergent.community/api-reference/helpers\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.emergent.community/api-reference/helpers#article\",\"headline\":\"Helper Functions\",\"name\":\"Helper Functions\",\"description\":\"Utility functions included with Emergent for building simulations quickly.\",\"url\":\"https://docs.emergent.community/api-reference/helpers\",\"mainEntityOfPage\":{\"@id\":\"https://docs.emergent.community/api-reference/helpers#webpage\"},\"dateModified\":\"2026-03-21T23:16:33.611Z\",\"publisher\":{\"@id\":\"https://docs.emergent.community/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.emergent.community#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Emergent\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Emergent\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/helpers.md","siteName":"Emergent","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/introduction"}]},{"tab":"API Reference","groups":[{"group":"emergent","pages":[{"title":"AgentModel","description":"Complete API reference for the AgentModel class.","href":"/api-reference/agent-model"},{"title":"Helper Functions","href":"/api-reference/helpers"}]}]}]},"basePath":"","title":"Helper Functions - Emergent","buildId":"dpl_9RFrWkXdFTJCytfx6jAofvAaEXr6","deploymentId":"dpl_9RFrWkXdFTJCytfx6jAofvAaEXr6","dynamics":[],"chunks":[]}