Agents

The beating hearts of agent-based models

As the name suggests, agents lie at the heart of agent-based modeling.

Every agent has a name and a unique identifier. As a simulation creator, you can set and change the name, but not the ID. The HASH Engine takes care of this for you, so don't worry about including the ID when creating agents.

JavaScript
Python
JavaScript
const agent = {
agent_id: <uuid v4>, //Set on_create by the hEngine
agent_name: <string>
}
Python
agent = {
agent_id = <uuid v4> #Set on_create by the hEngine
agent_name = <string>
}

Naming your agent is entirely optional. The simplest possible agent is simply {} (although it won't do much of anything!)

An individual agent has a state and a context.

An Agent

When we define the initial conditions of a simulation, we're defining the initial agents that will be present in the first timestep of the simulation, each of which will have its own state and context.

Three agents, ready to simulate.