next up previous contents index
Next: 3D-Display Implementation Up: Implementation of the Previous: Selection Mechanism

Interface to the Simulator Kernel

   

The simulator kernel of SNNS offers a set of interface functions (see also chapter gif) which allow a one way communication with the graphic routines. There the graphical user interface acts as the master, the kernel as the slave. The functions can be assigned to the following tasks:

The keys to all operations of the user interface (like adding or deleting units or links, changing attributes etc.) are always the unit number and the unit position. Therefore these two attributes always have to be unambiguous. On dealing directly with the unit numbers great caution is needed, since the kernel compresses its data structures during a save, thereby changing the unit numbers. The access via unit number, however, is much faster than via position, because a sequential search can be avoided that way.

The search is necessary, however, when the user interface has to process an event (ButtonPress, ButtonRelease, KeyPress, ...) which has occured in a window. A possible improvement would be an additional data structure which sorts all units by their grid positions. A linear linked list could, for example, be assigned to each row of the grid. The search time is then limited by the maximum number of units in a row. Unfortunately, for small nets the longer time to build up the display might outweigh the faster access time. In very large nets this mechanism could be a real improvement.

To increase the stability of the simulator, the current version always requests its data from the kernel (and not from global variables) in all situations where consistency is important. There are also data consistency checks contained in the code, before any change on the net is performed. This does not decrease system performance, since these requests are answered very fast by the kernel.

The type bool, used by all boolean functions of the kernel, is identical with the type Bool, used by all SNNS-XGUI functions. The type Bool is used by X windows and therefore is also used in the user interface.

typedef int Bool; \* User Interface *\
typedef int bool; \* Kernel *\

All functions in this interface have the prefix "` krui_"', to be able to identify the functions in this module. They are a part of the kernel functions.

More detailed information about the interface between XGUI and the kernel can be found in chapter gif or in the source files krui_typ.h and glob_typ.h of the kernel. Modules of the user interface which use kernel functions must include the file kr_ui.h.



next up previous contents index
Next: 3D-Display Implementation Up: Implementation of the Previous: Selection Mechanism



Niels Mache
Wed May 17 11:23:58 MET DST 1995