Project | Documents | Downloads | History | Links |
Continue Simulation
For modelling continue systems the GeneSim notation uses two SysML diagrams to specify systems and assemblies of systems: block definition diagrams and internal block diagrams. The block definition diagram models the properties and the operations of a system while hiding its structure. The internal block diagram specifies the behavior of a complex system by means of the interactions among its parts.
The behavior of continuous simple systems is expressed by functions, that is methods in block definition diagrams. Function can be specified as math expressions or by tables. In the future it is planned to support SysML parametrics to express functions and constraints for continuous systems. For functions defined by tables currently a very basic interpolation library is provided; to support more sophisticated interpolation/extrapolation techniques the DbPFLib project was launched.
SysML diagrams are saved in an XML format. If the model is complete and hence executable, the XML specification is used to generate the object-oriented library of classes that enacts the model. Currently the target language is C++, but the generation patterns are able to be tailored to support Java and C#.GeneSim toolset for continue systems
GeneSim started in 2004 investigating code generation for time sliced simulation of continue systems. While still in a research/prototype stage, this area is the most advanced in terms of demonstrable tools.
Designer. GeneSim Designer is the graphical modelling tool. It allows to specify
dynamic systems as SysML diagrams and to save them in the XML format suitable for code generation.
Designer supports the syntax of SysML block definition diagrams and internal block diagrams
as well as the GeneSim rules needed to specify executable systems.
The user interface of Designer offers a toolbar, a property window and drawing sheet able to
work on several diagrams at the same time. Manipulation of diagram items is similar to
other vector based drawing tools like
Dia.
Diagrams can be exported as images to be included in system documentation.
Designer is implemented in C++ using
wxWidgets for GUI programming and
Xerces for XML processing.
Designed by G.A. Cignoni and U. Vespier; implemented and maintained by U. Vespier.
Status: early prototype, not yet released.
Code generator. The code generator is the core item of the GeneSim
framework: it reads the dynamic system specification in the GeneSim XML format, performs
consistency checks, and, if the specification is well formed, produces the OO code
that executes it.
Code is generated using XML technology. The system specification is given in XML. The
XML parser does syntax and semantics checks according to a defined XML Schema. Additional
semantics controls are done on the DOM built by the parser. The DOM is then modified by
custom transformations to build an abstract structure of the code to be generated.
The last step of generation is then done by transformations driven by XSLT templates that
operate on the modified DOM. This last step is the only one that depends on the target
language. Currently code is generated in C++, to generate in other languages, like
for instance Java or C#, it is needed a new set of XSLT templates and a corresponding
runtime library.
Xerces
is used as XML parser library, and
Xalan as XSLT processor.
Currently the generator produces a set of plain and standard C++ classes.
A C interface and runtime libraries are included in the generated code to build a MS Windows
Dll that can be dinamically loaded. The set of generated files contains also project
definitions to immediately load and compile the code using one of the Open Source IDE's
Code::Blocks Studio or
Bloodshed DevC++, or
MS Visual C++ v. 7.1.
Designed by G.A. Cignoni and S. Masoni; implemented and maintained by S. Masoni and G.A. Cignoni.
Status: beta released.
Interactive driver. This is a generic GUI to test and run all
the GeneSim generated simulators. The driver can dynamically load the simulator Dll
and build a GUI for the system according to its exposed interface. The GUI can be used
to set inputs before starting a batch simulation or to change them interactively during
continuos or realtime simulations. The driver is able to start/stop/restart the simulation
and to reset the system to its initial state. It is possible to set the simulation clock
duration and to switch between batch and continuous modes. If support to data logging
was included at code generation time, logging can be enabled/disabled during simulation
and data are saved in CSV files for subsequent analysis.
The driver offers features to configure the system interface by arranging the
input/output elements in different panels and by selecting different views for each
elements. Interface configurations can be saved and applied to other (similar) systems.
Designed by G.A. Cignoni and A. Bresciani; implemented and maintained by A. Bresciani.
Status: beta released.
Script driver. This is a script interpreter to test and run all
the GeneSim generated simulators. Scripts offer basic commands to load the simulator
Dll, set inputs and run sequences of batch simulations controlling changes in the inputs
and printout of the results. If support to data logging was included at code generation time,
logging can be enabled/disabled during simulation and data are saved in CSV files.
The interpreter is provided as a library, to be integrated in other tools,
and as a command line application. The supported script language has a simple syntax
based on the CSV format.
Designed by G.A. Cignoni and A. Lulli; implemented and maintained by A. Lulli.
Status: beta released.
Copyright © 2006-2009 Giovanni A. Cignoni |