Lua Initialization¶
When a Lua file or script is loaded, the Cloe engine provides a preloaded
cloe table with a large API. This API is defined in part through a Lua
runtime, and in part from the C++ engine itself.
The following operations occur when the engine runs a simulation defined
by a Lua file: cloe-engine run simulation.lua
Read options from the command line and environment:
Lua package path (
--lua-path,CLOE_LUA_PATH)Disable system packages (
--no-system-lua)Enable LRDB Lua debugger (
--debug-lua)Cloe plugins (
--plugin-path,CLOE_PLUGIN_PATH)
Initialize Cloe Stack
Load plugins found in plugin path
Initialize Lua
Set lua package path
Load built-in Lua base libraries (e.g.
os,string)Expose Cloe API via
cloeLua tableLoad Cloe Lua runtime (located in the package
lib/cloe/luadirectory)
Start LRDB Lua debugger (Optional)
Source input files
Files ending with
.luaare merged as LuaOther files are read as JSON
Start simulation
Schedule triggers pending from the Lua script