Demonstrations for JNI interface

NOTE: THE JNI UI IS BROKEN
The steps below worked when we last checked, but the JNI UI has bugs.
See $PTII/jni/package.html for limitations and other details.
See $PTII/jni/doc/JNIActorHep.pdf for further documentation.

To run the JNI demos:

  1. run make all
    which will create the shared libraries
  2. run make demo
    which will start up Vergil with the proper classpath and path
    Note that under Windows with Cygwin, JNI requires that java be started from th launcher.exe program. Thus, running the JNI demos from Eclipse probably won't work
  3. Go to the meaningLife.xml - Simple model that answers the question to "the meaning of life, the universe, and everything", see meaningOfLife.c
  4. BUG: The user interface is broken, so for each actor you must configure the arguments. To do this, double click on the JNI actor, select "Configure", then "Configure Arguments", click the "Add" button and add the appropriate arguments.
    Note that you may get NameDuplication error messages, which can be ignored. Set the arguments:
    Name:
    output
    C or C++ Type:
    double
    Kind:
    return
    Then click "Commit"
  5. Double click on the blue JNICodeGenerator icon
    which will bring up the JNI Code Generator UI.
  6. Click on "Generate", which will create the interface code in the jni directory and compile it.
    If you have problems compiling, see the JNIUtilities documentation for suggestions.
  7. Close the JNI Code Generator by hitting the red x in the upper right.
  8. Click Run. You should see the answer: 42.0.
    Note that because of a bug that deletes all the relations, the easiest thing to do is to exit vergil and restart using make demo.
    An alternative is to close and reopen each model.
    Another alternative is to redraw the connections from the JNI actor to the other actors. To do this, select each connection from the JNI actor, delete it (you may see an exception, if so, click ok) and redraw the connection.

Description of the other models

Resources