|
1 | | -.. _running-the-example: |
| 1 | +.. _execution_modes: |
2 | 2 |
|
3 | | -Running an Example |
| 3 | +Execution Modes |
4 | 4 | ================== |
5 | 5 |
|
6 | | -After successfully installing ForeFire (either :doc:`from source <installation>` or via :doc:`Docker <quickstart>`), you can run the example simulation located in the ``tests/runff/`` directory. This helps verify your installation and introduces you to the basic command execution methods. |
| 6 | +In the :doc:`quickstart` guide, you launched the example simulation using the interactive Web UI. That is just one of several ways to operate the ``forefire`` interpreter. |
| 7 | + |
| 8 | +This page details all three primary execution modes, allowing you to choose the best method for your specific task: |
| 9 | + |
| 10 | +- **Direct Execution (Batch Mode):** Best for standard, non-interactive runs or for use in automated scripts. |
| 11 | +- **Interactive Console:** Ideal for experimenting with commands step-by-step or inspecting the simulation state. |
| 12 | +- **Web Interface:** Excellent for visual feedback and interactive demonstrations. |
| 13 | + |
| 14 | +Below, we demonstrate each method using the same ``real_case.ff`` script. |
7 | 15 |
|
8 | 16 | Simulation Files Used |
9 | 17 | --------------------- |
@@ -51,7 +59,10 @@ This is the simplest way to run a simulation non-interactively by feeding the en |
51 | 59 |
|
52 | 60 | ../../bin/forefire -i real_case.ff |
53 | 61 |
|
54 | | -3. **Observe:** ForeFire will print status messages to the console as it executes the commands within ``real_case.ff``. It will likely create output files (as specified by ``print``/``save`` commands in the script) in the current directory (``tests/runff``). |
| 62 | +3. **Observe:** ForeFire will create 2 files: |
| 63 | + |
| 64 | + - ``to_reload.ff``: a Forefire ascii state file ready to be reincluded or modified to run |
| 65 | + - ``ForeFire.0.nc``: a burning map matrix in netcdf |
55 | 66 |
|
56 | 67 | 2: Interactive Console |
57 | 68 | ~~~~~~~~~~~~~~~~~~~~~~ |
@@ -84,15 +95,15 @@ This method starts the ForeFire interpreter first, allowing you to execute the s |
84 | 95 |
|
85 | 96 | .. code-block:: none |
86 | 97 |
|
87 | | - forefire> include[input=real_case.ff] |
| 98 | + forefire> include[real_case.ff] |
88 | 99 |
|
89 | 100 |
|
90 | | -4. **Observe:** The simulation will run similarly to Method 1, executing the commands from ``real_case.ff`` and printing output to the console. Afterwards, you remain in the interactive console (``forefire>`` prompt) and can inspect parameters (e.g., ``getParameter[propagationModel]``), run further steps manually (e.g., ``step[dt=600]``), or exit using ``quit[]``. |
| 101 | +4. **Observe:** The simulation will run similarly to Method 1, executing the commands from ``real_case.ff``. Afterwards, you remain in the interactive console (``forefire>`` prompt) and can inspect parameters (e.g., ``getParameter[propagationModel]``), run further steps manually (e.g., ``step[dt=600]``), or exit using ``quit[]``. |
91 | 102 |
|
92 | 103 | 3: Web Interface |
93 | 104 | ~~~~~~~~~~~~~~~~ |
94 | 105 |
|
95 | | -This method uses the built-in HTTP server to provide a web-based console and map visualization. It executes commands in the same way as the interactive console but through your browser. |
| 106 | +This method, which you may have already used in the :doc:`quickstart` guide, uses the built-in HTTP server to provide a web-based console and map visualization. It executes commands in the same way as the interactive console but through your browser. |
96 | 107 |
|
97 | 108 | 1. **Navigate to the test directory** (if not already there): |
98 | 109 |
|
@@ -120,14 +131,14 @@ This method uses the built-in HTTP server to provide a web-based console and map |
120 | 131 |
|
121 | 132 | Alternatively, to launch the HTTP server directly without entering the interactive console first, you can use the `-l` command-line option. This is convenient if you primarily want to use the web interface. |
122 | 133 |
|
123 | | - .. code-block:: none |
| 134 | + .. code-block:: bash |
124 | 135 |
|
125 | 136 | forefire -l |
126 | 137 |
|
127 | 138 | 4. **Use the Web Interface:** |
128 | 139 |
|
129 | 140 | - Open your browser to ``http://localhost:8000/`` (or the specified port). |
130 | | - - In the command input box in the web UI, type ``include[input=real_case.ff]`` and press Enter or click Send. This executes the script file relative to where the interpreter was started (which we ensured was `tests/runff`). |
| 141 | + - In the command input box in the web UI, type ``include[real_case.ff]`` and press Enter or click Send. This executes the script file relative to where the interpreter was started (which we ensured was `tests/runff`). |
131 | 142 | - Click "Refresh Map" periodically to see the simulation progress visually. You can also type other commands directly into the web console. |
132 | 143 |
|
133 | 144 | Choosing a Method |
|
0 commit comments