Get StartedBlocksSimulationsContributing
Launch HASH

Globals


Global variables are defined in the globals.json file present within every simulation. These variables are immutable while the simulation is running and are accessible to all agents simultaneously.‌

Globals are typically used to specify environmental variables (e.g. topology) or macro assumptions (simulation parameters) that define the state of the world.

Accessing these global variables is as simple as using the context.globals() function in any agent behavior.

To modify globals while a simulation is running, first pause the simulation before making any changes, reset the simulation, and resume.

HASH does not support modifying globals mid-step, but support for modifying globals between steps is coming soon.

There are two types of global variables in HASH:

  • simulation parameters - these capture truths or assumptions about the state of your world
  • topological parameters - define the extent of the world using bounds and wrapping, determine how agents interact with the borders (if any) of spatial simulations using wrapping presets and flags, and configure how distance calculations are conducted across topologies

Previous

Messages

Next

Datasets

Join our community of HASH developers

Browse open issues
Star us on GitHubGet in touch