Constructor
new WasmLayer(reportProgressCallback, poolSize)
Create a new WasmLayer instance.
Parameters:
| Name | Type | Default | Description |
|---|---|---|---|
reportProgressCallback |
function | Callback for progress updates. | |
poolSize |
number | null | null | Optional worker pool size. If null, auto-calculated from navigator.hardwareConcurrency. |
- Source:
Methods
initialize() → {Promise.<void>}
Initialize the worker pool and prepare for execution.
- Source:
Returns:
Promise that resolves when all workers are ready.
- Type
- Promise.<void>
(async) runSimulation(code, scenarioNames, scenarioTrialCounts) → {Promise.<BackendResult>}
Execute QubecTalk code and return backend result.
Parameters:
| Name | Type | Description |
|---|---|---|
code |
string | The QubecTalk code to execute. |
scenarioNames |
Array.<string> | Array of scenario names to execute. |
scenarioTrialCounts |
Object.<string, number> | Map of scenario name to trial count. |
- Source:
Returns:
Promise resolving to backend result with CSV and parsed data.
- Type
- Promise.<BackendResult>
terminate()
Terminate all workers and clean up resources.
- Source: