rti(n): A Tcl Binding
Will's first slide made people laugh—
WARNING
This presentation contains C++ snippets of a graphic nature.
Viewer discretion is advised.
Thought of the day: SQLite rocks.
Also JPL looking to hire someone good. Contact Will for more information.
JNEM: Join Non-kinetic Events Model
- Models civilian population in asymetric warfare environments
- Used by Battle Command Training Program
- JNEM 1.1 implemented for U.S. Army's National Simulation Center
- Cooperates with other training simulations
- Communications via HLA/RTI
Army did not expect it to be delivarable in < a year, but Tcl made it more than possible.
HLA/RTI born because "Your ground sim won't play nicely with my air sim!"
Early efforts: ALSP (Aggregate Level Simulation Protocol or "A Little Slower Please"). DIS (Distributed Interactive Simulation, still in use). Military thinkers decided "We need a Run-Time Infrastructure that supports our High Level Architecture". HLA/RTI was born.
Definitions
- Federation
- a collection of cooperating HLA applications
- Federate
- one of those applications (a federate can join or resign from a federation)
- Interaction
- Message sent from one federate to all interested federates (notices "this happened", orders "please do this for me" but no notion of a return status). Interaction is basically a dictionary containing parameters and their values. Sender publishes interaction class, receivers subscribe to the interaction class.
- Object
- a dictionary of attributes and their values (couldn't be parameters ;-). A federate publishes attributes of an object class; others subscribe. A federate registers an object; others discover the object. Federate updates attributes of the object; other federates reflect the updated attribute values. (Standard likes to use as many different terms as possible. Member function names are extremely verbose. All RTI API calls are member functions of RTIambassador class.)
Fom-o-rama (when you get together with other federates to decide the FOM—Federation Object Model).
Tcl API goals for the rti(n) extension developed for JNEM
- One to one mapping from C++ to Tcl
- Code should be readable by an experienced RTI programmer without reference to the man page
- But wanted to follow standard Tcl conventions and exploit Tcl's strength
- Shouldn't implement application or federation specific policies
- Not a loadable extension (compiled into tcl shell)
JNEM all exceptions handled by bgerror (with stack traces to the debugging log). Users astounded that JNEM never crashes.
Examples of very verbose C++ code contrasted with their much more brief (and readable) Tcl equivalents.
Some deficiencies
- Doesn't use Tcl/Tk event loop
- API overly verbose (to match C++ API)
- Lots of policy functionality left to the application
- Callbacks are too large-grained (one callback for all interactions and object updates)
Created a Snit rtiproxy object to avoid these deficienciences. Provides a heirarchial command set (like the [text] and [canvas] widgets). Tk man pages are automatically outline oriented. Snit makes it easier to create simillar structures. Slides showing difference between rti and rtiproxy calls.
JNEM is the sexiest simulation the Army has seen. Has had nine federations want JNEM to join them.
Got permission from project sponsor on Tuesday to open source
it
the rti(n) Tcl extension being described in the paper.
Will work through JPL procedures to do so in the near future.
—Michael A. Cleverly
Thursday, October 12, 2006 at 09:54
I've updated the last paragraph to note that the antecedent of the "it" was meant to be the rti(n) Tcl extension (and not the JNEM simulation itself, which is obviously proprietary and highly specific to the Army).
My notes as originally written (in realtime) could have been read to make it sound like the entirety of JNEM would be open-sourced. This is not the case (and not what Will said or implied during his talk) and I apologize for any confusion otherwise.
Fri, 20 Oct 2006, 12:24