Skip to content

Commit

Permalink
GitBook: [master] 5 pages modified
Browse files Browse the repository at this point in the history
  • Loading branch information
hashdotai authored and gitbook-bot committed Jun 15, 2021
1 parent b212da7 commit d3b3585
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 15 deletions.
3 changes: 2 additions & 1 deletion resources/docs/simulation/SUMMARY.md
Expand Up @@ -117,7 +117,8 @@
* [Trucks on the Move](extra/migrating/anylogic/building-the-simulation/trucks-on-the-move.md)
* [Full Initialization](extra/migrating/anylogic/building-the-simulation/full-initialization.md)
* [Improving our Visualization](extra/migrating/anylogic/building-the-simulation/improving-our-visualization.md)
* [Error Reference & Debugging](extra/error-reference.md)
* [Troubleshooting & Debugging](extra/troubleshooting-1/README.md)
* [Error reference](extra/troubleshooting-1/error-reference.md)
* [Determinism](extra/determinism.md)
* [Performance](extra/performance.md)
* [System Requirements](extra/specs-requirements.md)
Expand Down
31 changes: 31 additions & 0 deletions resources/docs/simulation/extra/troubleshooting-1/README.md
@@ -0,0 +1,31 @@
---
description: Debugging simulation logic and application crashes
---

# Troubleshooting & Debugging

## Debugging

{% embed url="https://youtu.be/lqEZk0Xp51U" caption="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](error-reference.md) for an explanation of specific errors.

## Troubleshooting crashes

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

![](../../.gitbook/assets/screenshot-2021-06-15-at-10.24.37.png)

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](https://support.google.com/accounts/answer/32050), [Firefox](https://support.mozilla.org/en-US/kb/how-clear-firefox-cache), [Edge](https://support.microsoft.com/en-us/microsoft-edge/view-and-delete-browser-history-in-microsoft-edge-00cf7943-a9e1-975a-a33d-ac10ce454ca4). 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](https://get.webgl.org/).
5. **Contact us** Please [contact us](https://hash.ai/contact) 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.

@@ -1,10 +1,10 @@
---
description: Errors and what they mean
description: Errors you may encounter and how to fix them
---

# Error Reference & Debugging
# Error reference

{% embed url="https://youtu.be/lqEZk0Xp51U" caption="Debugging tutorial" %}
You may see a red error message pop up when running a simulation - here's some of the most common, and how to fix them.

<table>
<thead>
Expand All @@ -26,13 +26,13 @@ description: Errors and what they mean
<tr>
<td style="text-align:left">ERROR running simulation: <code>[error]</code> did not match any variant
of untagged enum OutboundMessage</td>
<td style="text-align:left">All <a href="../creating-simulations/agent-messages/">messages</a> must
<td style="text-align:left">All <a href="../../creating-simulations/agent-messages/">messages</a> must
have a <code>to</code> and <code>type</code> field this error indicates the
type is missing.</td>
</tr>
<tr>
<td style="text-align:left">D is not a function.</td>
<td style="text-align:left">Check <a href="../creating-simulations/views/analysis/">analysis</a>.json
<td style="text-align:left">Check <a href="../../creating-simulations/views/analysis/">analysis</a>.json
- this can indicate you referenced an output that doesn&apos;t exist or
used an incorrect operation.</td>
</tr>
Expand All @@ -48,11 +48,3 @@ description: Errors and what they mean

We're expanding this list with more errors, explanations, and fixes. If you encounter an error that is unclear, [let us know](https://hashpublic.slack.com/archives/C0151PYN1T4).

## Debugging

A few tips for debugging 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.

2 changes: 1 addition & 1 deletion resources/docs/simulation/extra/troubleshooting.md
Expand Up @@ -8,7 +8,7 @@ This page is to help with issues where hCore fails to load, or crashes, with a s

![](../.gitbook/assets/screenshot-2021-06-15-at-10.24.37.png)

If you're looking for help with debugging simulation logic, head over to [debugging](error-reference.md).
If you're looking for help with debugging simulation logic, head over to [debugging](troubleshooting-1/).

### What to try if you encounter a crash

Expand Down

0 comments on commit d3b3585

Please sign in to comment.