Return to search

Dynamic Model Creation and Scripting Support in the Horizon Simulation Framework

Dynamic model creation and support for the Lua scripting language was added to the Horizon Simulation Framework used for the verification and validation of system-level requirements. The addition of scripting support allows for subsystem models and their algorithms to be defined using a simpler scripting language, rather than C++. The Luabind library by Rasterbind software is used to expose the C++ algorithms and classes to Lua that are already defined in the framework. Interoperability between Lua and C++ code allows for the ease of use of a scripting language while utilizing the utility classes and functions already created. The dynamic model creation algorithm developed allows for the structure and logic of the simulated system to be defined completely using XML and text files as input to the framework. Dynamic model creation prevents the need to re-compile the framework every time small changes are made and greatly simplifies the changes required to simulate a different model. A runtime analysis shows that using a scripting language does not decrease the performance significantly, while increasing usability and decreasing the time required to set up simulations. Tests where the scripted code uses only classes and function exposed by luabind show that there is virtually no performance decrease when compared to the same algorithms in C++. Performance decreases as more of the algorithm implemented is executed in Lua. An example test scenario that represents the typical use of the framework showed only a minor decrease in performance. The multi-threaded scheduler developed works with the scripting support and allows for modern multi-core or multi-processor computers to be used most efficiently for simulations. This thesis describes the algorithms of dynamic model creation and scripting support, as well as the methodology used to expose C++ code to Lua. This thesis also presents the architecture changes required to support dynamic model creation, scripting support, and multi-threaded scheduling. Finally, runtime results of the added scripting support are presented.

Identiferoai:union.ndltd.org:CALPOLY/oai:digitalcommons.calpoly.edu:theses-1730
Date01 February 2012
CreatorsButler, Brian Jeffrey
PublisherDigitalCommons@CalPoly
Source SetsCalifornia Polytechnic State University
Detected LanguageEnglish
Typetext
Formatapplication/pdf
SourceMaster's Theses

Page generated in 0.0017 seconds