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, so don't worry about including this when creating agents.

JavaScript
Python
Rust
JavaScript
{
agent_id: <uuid v4>, //Set on_create by the hEngine
agent_name: <string>
}
Python
class Agent:
agent_id = <uuid v4> #Set on_create by the hEngine
agent_name = <string>
Rust
struct Agent {
agent_id: uuid, //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.