Demonstrations for JNI interface
See $PTII/jni/package.html
for limitations and other details.
See $PTII/jni/doc/JNIActorHep.pdf
for further documentation.
To run the JNI demos:
- run
make all
which will create the shared libraries
- run
make demo
which will start up Vergil with the proper classpath and path
- BUG: The user interface is broken, so for each actor
you must configure the arguments. To do this, right click
on the JNI actor, select "Configure", then "Configure Arguments", click
the "Add" button and add the appropriate arguments.
Note that you will get NameDuplication error messages,
which can be ignored
-
meaningLife.xml
-
Simple model that answers the question to
"the meaning of life, the universe, and everything", see
meaningOfLife.c
- Name:
output
- C or C++ Type:
double
- Kind:
return
-
testDeux.xml
-
Interface to a function that takes an int and a float and
returns a double. The float is both an input and an output
testDeux.c
PROBLEM: The user interface allows the user to add one argument,
but not two.
-
testQuatre.xml
-
Interface to a function that takes two arrays of longs.
The second argument is both an input and an output.
testQuatre.c
-
testTrois.xml
-
Uses testDeux and testQuatre.
- For each model, double click on the blue JNICodeGenerator icon
which will create the interface code in the
jni
directory
and compile it. The output will appear in standard out.
If you have problems compiling, see the
JNIUtilities documentation for suggestions.
- 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.
- Run each model