8 th Annual Tcl/Tk Conference 29 July 2001 Ronald A. Bowers Robert G. Parker Paul J. Tanenbaum U.S....
-
Upload
silvester-clement-mcbride -
Category
Documents
-
view
215 -
download
0
Transcript of 8 th Annual Tcl/Tk Conference 29 July 2001 Ronald A. Bowers Robert G. Parker Paul J. Tanenbaum U.S....
8th Annual Tcl/Tk Conference
29 July 2001Ronald A. BowersRobert G. ParkerPaul J. TanenbaumU.S. Army Research LaboratorySurvivability/Lethality Analysis Directorate
Tcl/Tk in Survivability Modelingfor Military Systems
What We Do
• Our mission is to analyze the survivability of Army systems against a wide variety of threats, including ballistic threats such as bullets, missiles, and bursting artillery rounds, as well as electronic, chemical, and biological threats.
• Testing is very expensive and can be dangerous; therefore, we use modeling extensively.
• For ballistic threats, the primary analysis model is a program called MUVES.
• Ballistic analysis requires knowledge of the target geometry, which is captured using a tool called BRL-CADTM.
BRL-CAD Primitive Shapes
wedge
cylinder
block
(wedge block) cylinder
wedge block cylinder
block (wedge cylinder)
CSG Boolean Operations
Some Pieces of a BRL-CAD Database
All primitives
shown.
Primitives found by
query ray.
BRL-CAD Software Libraries
libbn Numerical computation, quaternions, wavelets, ...
libbu Utilities: memory mgmt, parallel processing, ...
libdm Display manager: X, OGL, PostScript, ...
librt Ray tracing
libpng PNG
libz Data compression
libtcl Tcl
libtk Tk
libitcl [incr Tcl/Tk] and [incr Widgets]
Object Orientation
• Initially we packaged instances of library objects as Tcl commands.
tclsh> wdb_open db scene.g
db
tclsh> db ls
LIGHT cone.r/R light.r/R
tor.r/R all.g/ cone.s
platform.r/R box.r/R ellipse.r/R
platform.s box.s ellipse.s
tor
Object Orientation
• Now we are wrapping those objects in [incr Tcl] classes.
itcl::class Db {
protected variable db ""
public variable dbfile ""
constructor {filename} {
set dbfile $filename
set db [subst $this]_db
wdb_open $db $dbfile
}
destructor {} { rename $db "" }
public method ls {args} { eval $db ls $args } }
MUVES
• MUVES is a tool for vulnerability/lethality analysis—stochastic and deterministic—of ballistic threats against ground and air systems.
• MUVES consists of 410,000 lines of C code, including graphical user interface and general-purpose packages.
•
Targetgeometry
Personneldata
Component vulnerability
Criticalityanalysis
Behind-armor debris
Impact conditions
Threat characterization
Residual penetrationPersonnel incapacitationComponent damageSubsystem capabilitiesRemaining system utilityUser-defined criteria
...
MUVES
MUVESinputs & outputs
Pcd/h
v
mv
glacisarmor
armor-piercingrounds
HEround
firewall
enginestarter
transmissionsump
fan reararmor
A Ray-Tracing Application: Shotlining
DMUVES
• Distributed MUVES (DMUVES) is an enhancement to MUVES that enables an analysis to be run in parallel on a single computer and distributed upon multiple networked computers.
The Original MUVES Architecture
raytracerBRL-CAD
Target Description
Analyzer
Final Results File
Threats File
Pipe
View File
raytracer
raytracer
raytracer
Other Input Files Ray Requests
Ray Results
Run times were horrific, but converting the analyzer into a multithreaded application was deemed too costly.
Boss
Input Files
MUVES GUI
The DMUVES Approach
daemon
daemon
Host A
Host B
Host C
Workers
The Use of Tcl in DMUVES
daemonIfTask Manager
daemon
workerIf
Tcl Event Handler
FinalResults
File
Tcl
scr
ipts
ove
r so
cket
s
The workers also use Tcl event handlers to monitor their socket connections.
Boss
Worker
ResultsManager
The daemon is written entirely in [incr Tcl].
Performance Results
2880
920
210 130 95 250
500
1000
1500
2000
2500
3000
3500
1 3 12 24 48 96
Number of Workers
Run
Tim
e (m
inut
es)
.
Brake control rod (left)
Syncro brake crank
Syncro brake rod
Syncro mechanism
Brake crank
Brake control rod
Brake pedal lever
Brake control rod (right)
Braking controls
MUVES System Evaluation
Lessons Learned
• Developing portable GUIs is far easier with Tcl/Tk than with other packages such as Java Swing, MFC, Motif, Athena, and raw X.
• Use [incr Tcl/Tk].
• Get Tcl/Tk training early.
Plans
• BRL-CAD– Gradually replace first-generation Tcl code with [incr Tcl].
– Implement object-oriented geometry?
• MUVES– Wrap additional MUVES functions.
– Continue transitioning tools from X to Tk.
– Replace ASCII boss-to-worker messages with binary.
– Add additional boss and worker tasks,
including tasks expressed in Tcl.
– Couple MUVES parameters to Tcl variables.