Class KigaliWasmSimFacade
java.lang.Object
org.kigalisim.KigaliWasmSimFacade
Facade which offers access to JS clients.
Entry point for the KigaliSim command line application which can run simulations from within the browser via TeaVM.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringExecutes all scenarios in the provided QubecTalk code and returns the results.static StringexecuteScenario(String code, String scenarioName) Executes a single scenario from the provided QubecTalk code.static StringReturns the version of KigaliSim.static voidRequired entrypoint for wasm.
-
Constructor Details
-
KigaliWasmSimFacade
public KigaliWasmSimFacade()Constructs a new KigaliWasmSimFacade.
-
-
Method Details
-
getVersion
Returns the version of KigaliSim.- Returns:
- The current version string.
-
execute
Executes all scenarios in the provided QubecTalk code and returns the results.This method parses and executes the provided QubecTalk code, running all scenarios defined in the code. It returns a formatted string containing:- A description of the execution result: either "OK" for success or "Error: message" for failure.
- A blank line
- The CSV contents with the simulation results
- Parameters:
code- The QubecTalk code to execute.- Returns:
- A formatted string with execution status and CSV results.
-
executeScenario
Executes a single scenario from the provided QubecTalk code.- Parameters:
code- The QubecTalk code to execute.scenarioName- The name of the specific scenario to execute.- Returns:
- A formatted string with execution status and CSV results for the single scenario.
-
main
Required entrypoint for wasm.- Parameters:
args- ignored arguments
-