Troubleshooting & Debugging


There are two types of errors you may encounter when using hCore:

  • errors in simulation logic: a red message when running a simulation.
  • errors at the application level: a crash which requires a refresh or other browser action.

Debugging simulation errors

Debugging tutorial

A few tips for debugging simulation errors:

  • You can use console.log() in JavaScript behaviors or print() in Python behaviors to output the value of a variable or an expression to the developer console (Ctrl+Shift+J on Windows, or Cmd+Option+J on Mac).
  • The Raw Output panel displays the full state of your simulation, which can be useful for figuring out what's going on. Keep in mind though it generates it for the last completed time-step - if your simulation has an error in the middle of a time-step the Raw Output panel will only show you the state that you entered the time-step with.
  • Often it's easiest to debug simulations with the bare minimum number of agents, to make it easier to track what's going on. Try reducing the number you create to simplify.
  • Please see the error reference for an explanation of specific errors.

Troubleshooting crashes

Despite our best efforts, sometimes hCore crashes with a screen that looks like this:

We hope you never see hCore crash. But if you do, there are a few things you can try:

  1. Refresh the page This will usually do the trick.
  2. Clear your browser cache (saved data) Sometimes the files or configuration details that hCore depends on get into a weird state and need to be reset. You can read how to do this on Chrome, Firefox, Edge. Note that this can also clear saved passwords and other data, so check any settings in the process carefully. You can also try opening a private/incognito window first - if it works there, clearing your browser cache is likely to make it work in a regular window.
  3. Try a different browser Some errors are specific to certain browsers or browser versions.
  4. Close other browser windows or browser tabs Some errors are caused by resources being unavailable, and closing other browser windows can help free them up. If the error details mention memory or WebGL this may help. For errors relating to WebGL (which renders graphics), you can also check your browser's support here.
  5. Contact us Please contact us if you have trouble recovering from a crash, if you encounter them repeatedly, or if there is other useful information we could add to this page.