Title: Distributed-OMAR: Reconfiguring a Lisp System as a Hybrid Lisp/(Java) Component
1Distributed-OMARReconfiguring a Lisp System as
a Hybrid Lisp/(Java) Component
Nichael Cramer 17 Nov 1998
GTE-I / BBN Technologies
2The OMAR System
- Additional information
- Stephen Deutsch (sdeutsch_at_bbn.com).
- http//www.sover.net/nichael/misc/
- (Papers available at front.)
GTE-I / BBN Technologies
Distributed-OMAR
3The OMAR System
- Simulation Development Environment.
- Editing/Browsing tools.
- Displays for runtime monitoring.
- Application-specific displays (e.g. radars).
- Procedure language (SCORE).
- Simulation engine.
- Human in the Loop experiments.
GTE-I / BBN Technologies
Distributed-OMAR
4The OMAR System
- OMAR has been primarily used in the modeling of
human performance. - Multi-tasking capabilities of human-operators.
- Teamwork activities.
- Air Traffic Control and Flight Deck simulation.
GTE-I / BBN Technologies
Distributed-OMAR
5The OMAR System
- For the present talk
- OMAR is a large, simulation application, written
in Lisp (ACL) and CLIM, running on Unix (Solaris
and SGI) platforms. - Signal/Event-based semantics for inter-procedure
communication.
GTE-I / BBN Technologies
Distributed-OMAR
6 Distributed-OMAR
- OMAR was successful.
- (I.e. the customer was very happy.)
- Interest in distributing OMAR.
- OMAR as intelligent agent in existing systems.
- Network of OMAR agents.
- Interact with other agents/components.
- Web-based operation.
GTE-I / BBN Technologies
Distributed-OMAR
7Distributed-OMAR Architecture Design Goals
- Distributed
- OMAR should be able to participate as an equal in
distributed systems consisting of multiple
remote, independent Agents or other Components. - OMARs internal modules should be able to run in
a distributed manner as needed.
GTE-I / BBN Technologies
Distributed-OMAR
8Distributed-OMAR Architecture Design Goals
- Flexible.
- Usable with
- Broad range of systems.
- Multiple external languages/platforms.
- Assortment of middleware choices.
- Stable as standards change.
GTE-I / BBN Technologies
Distributed-OMAR
9Distributed-OMAR Architecture Design Goals
- Robust and Maintainable.
- To the extent possible, there should be a single
D-OMAR - I.e. not a Corba-OMAR a RMI-OMAR etc.
- Main System Functionality in Core-OMAR (Lisp)
system. - Efficient.
GTE-I / BBN Technologies
Distributed-OMAR
10Distributed-OMAR Architecture Design Goals
- Maintain the central Lisp functionality.
- Maintain the advantages that Lisp provides.
- Dynamic class inheritance.
- Rapid-prototyping capabilities.
- Etc.
- Specifically Want to be able to continue writing
the core simulation engine in Lisp.
GTE-I / BBN Technologies
Distributed-OMAR
11Distributed-OMAR Architecture Overview
- Distributed-OMAR presents itself to the external
components as being a single unified component in
the target language. - Examples
- An OMAR Bean in Java.
- An OMAR Federate in HLA.
GTE-I / BBN Technologies
Distributed-OMAR
12Distributed-OMAR Architecture High-Level
Structure
- Core-OMAR module...
- (Compact version of Lisp simulation system.)
- through inter-module communication
- (Socket-based serialization protocol.)
- to Connection in External language.
- (Presence of D-OMAR in foreign language.)
GTE-I / BBN Technologies
Distributed-OMAR
13Distributed-OMAR Architecture High-Level
Structure (cont.)
- In external Language, D-OMAR presents a basic
External Connection object. - External Connection behaves as a source and sink
of D-OMAR events in the External language.
GTE-I / BBN Technologies
Distributed-OMAR
14Distributed-OMAR Architecture
- Can run with assortment of external languages.
- Java is language of choice.
- But, other languages available.
- Piggy-back off features of external or embedded
language. - Can use standard networking tools.
- E.g. RMI in Java CORBA HLA
- Graphics packages, etc.
GTE-I / BBN Technologies
Distributed-OMAR
15Distributed-OMAR Architecture
- The Core-OMAR system remains compact and intact.
- Remains in pure CommonLisp.
- It continues to be able to do what it does well.
- Only a small layer (Cap) needs to changed to work
in different systems.
GTE-I / BBN Technologies
Distributed-OMAR
16Core OMAR Module
- Original Lisp Kernel.
- Score
- SFL
- Rule-based language
- Pure Common Lisp
- Plus socket package.
- Direct graphics/editing support removed.
- Primarily Signal (Event) based semantics.
Core OMAR
GTE-I / BBN Technologies
Distributed-OMAR
17Core OMAR API
- Well-defined, cleaned-up functional API protocol.
- Commander
- Incoming Commands
- Listener
- Outgoing Commands
Core OMAR
GTE-I / BBN Technologies
Distributed-OMAR
18OMAR Master
- Implementation of the Core-OMAR API.
- Governs communication with outside world.
- More than one possible implementation.
- Command-Line.
- OMAR Classic
Master
Core OMAR
GTE-I / BBN Technologies
Distributed-OMAR
19Distributed Master
- Communicates to external Connections
- Connection written in language of host system
(e.g. Java, C). - Communication is a socket-based, serialization,
message-passing protocol.
GTE-I / BBN Technologies
Distributed-OMAR
20Sockets
- Sockets
- Standard mechanism for inter-process
communication. - TCP/IP based communication layer.
- Common to virtually all platforms.
GTE-I / BBN Technologies
Distributed-OMAR
21Serialization
- Serialization
- Mechanism for moving objects (Strings, Events,
Structures, etc) between processes. - (Encoding representation of Objects into a
byte-stream representation, to be decoded by an
external process.)
GTE-I / BBN Technologies
Distributed-OMAR
22Message-Passing
- Message-passing
- High-level specification of a request for a
state-change. - Event, method call, .
- In the stream, an object with a state-flag and
a set of arguments.
GTE-I / BBN Technologies
Distributed-OMAR
23Distributed Master (continued)
- External Connections can run on
- Same machine (standard mechanism).
- Different machine.
- Event-based communication.
- Independent of language of Connection.
- Single protocol for all Connection types.
GTE-I / BBN Technologies
Distributed-OMAR
24Distributed Master (continued)
- Current Connection types
- Control GUI Connection.
- OMAR editing and simulation-control panels.
- Application GUI Connection.
- Panels specific to Current application.
- External Connection.
- Communicates with other Agents.
GTE-I / BBN Technologies
Distributed-OMAR
25Distributed-OMAR Component
Control GUI Connection
Distributed Master
Core OMAR
Java External Connection
Application GUI Connection
GTE-I / BBN Technologies
Distributed-OMAR
26Control GUI Connection
Scenario Control Panel
Distributed Master
Core OMAR
Procedure Browser
Control GUI Connection
LISP
JAVA
Concept Editor
GTE-I / BBN Technologies
Distributed-OMAR
27Control GUI Connection -Java
- In the Java world, OMAR (as viewed through the
external Connection) is now just another Java
component. - To which other Java component connect in a
standard way.
GTE-I / BBN Technologies
Distributed-OMAR
28Control GUI Connection -Java(continued)
- Can use any standard Java mechanism for
inter-component communication. - Regular Object-Oriented method calls.
- RMI.
- For example, publish and subscribe to Events in
standard way (Listener).
GTE-I / BBN Technologies
Distributed-OMAR
29Control GUI Connection -Java (continued)
- In short, foreign-language Connection behaves as
conduit into Core-OMAR. - Connections serve as sources and sinks of
Events in the Java world. - Finally, nothing special about the fact that the
connection is written in Java.
GTE-I / BBN Technologies
Distributed-OMAR
30Control GUI Connection
Scenario Control Panel
Distributed Master
Core OMAR
Procedure Browser
Control GUI Connection
Concept Editor
GTE-I / BBN Technologies
Distributed-OMAR
31Distributed-OMAR Architecture
External D-OMAR Agent 1
Control GUI Connection
Distributed Master
Core OMAR
External D-OMAR Agent 2
Application GUI Connection
External Agent 3
GTE-I / BBN Technologies
Distributed-OMAR
32Communication with External Agents
- Standard External Connection Object.
- Common to all module types.
- D-OMAR presents a thin Cap to External
language. - Wrapper on External-Connection object.
- Specific to communication/middleware type.
- Inner structure hidden to outside world.
GTE-I / BBN Technologies
Distributed-OMAR
33Communication with External Agents
External Agent 1
Communication Specific Cap
External Agent 2
External Agent 3
GTE-I / BBN Technologies
Distributed-OMAR
34Communication with External Agents
- Java Inter-Agent Communication
- Standard O-O method invocation.
- RMI (Remote Method Invocation).
- Corba
- Voyager
- HLA
GTE-I / BBN Technologies
Distributed-OMAR
35 Standard O-O Method Invocation
External Agent 1
Standard Cap
External Agent 2
GTE-I / BBN Technologies
Distributed-OMAR
36 Remote Method Invocation (RMI)
External Agent 1
RMI Cap
Central Remote Server
External Agent 2
GTE-I / BBN Technologies
Distributed-OMAR
37 ORB Connection (e.g. Corba)
External Component 1
Corba Cap
O R B
External Component 2
GTE-I / BBN Technologies
Distributed-OMAR
38Distributed-OMAR Architecture
External D-Omar Agent 1
Control GUI Connection
Distributed Master
Core OMAR
External D-Omar Agent 2
Application GUI Connection
External Agent 3
Distributed Omar Component
Remote Systems
GTE-I / BBN Technologies
Distributed-OMAR
39OMAR Communication with Other Implementation
Languages
- Event-communication doesnt depend on details of
Event-Listener. - Connection only needs to support
- Sockets.
- Serialization protocol.
GTE-I / BBN Technologies
Distributed-OMAR
40OMAR Communication with Other Implementation
Languages
- Connection need not be written in Lisp or Java.
- Nothing in Core-OMAR module changes.
- An example HLA.
GTE-I / BBN Technologies
Distributed-OMAR
41D-OMAR/HLA Architecture
External Federate 1
Control GUI Connection (Java)
Federate Cap
Distributed Master (Lisp)
Core OMAR (Lisp)
R T I
C External Connection
External Federate 2
Application GUI Connection (Java)
GTE-I / BBN Technologies
Distributed-OMAR
42D-OMAR/HLA Architecture
- C based External Connection and HLA Cap have
been implemented and initially tested. - Currently converting to vendor supplied Java/C
Federate interface/wrapper.
GTE-I / BBN Technologies
Distributed-OMAR
43Distributed-OMAR Architecture Summary/Status
- Consolidated Core-OMAR kernel.
- In Common-Lisp/CLOS
- Processes.
- Socket-code.
- (Again, no graphics code.)
- Can run in any Lisp that supports these.
- Currently using Allegro Common-Lisp.
- (MCL all but sockets/Open Transport).
- (Harlequin)
GTE-I / BBN Technologies
Distributed-OMAR
44Distributed-OMAR Architecture Summary/Status
(continued)
- Standard Protocol for Connection to External
Languages. - Current implementations in
- Java.
- C (HLA).
- Lisp.
GTE-I / BBN Technologies
Distributed-OMAR
45Distributed-OMAR Architecture Summary/Status
(continued)
- GUI implementation in Java.
- Implementation of Java-based communication among
collection of D-OMAR agents. - In Java Runs anywhere.
GTE-I / BBN Technologies
Distributed-OMAR
46Distributed-OMAR Architecture Summary/Status
(continued)
- Current Platforms
- Windows NT/98.
- Sun/Sparc.
- (SGI)
- (MacIntosh)
GTE-I / BBN Technologies
Distributed-OMAR
47Distributed-OMAR Architecture Summary/Status
(continued)
- Middlewares used.
- Corba.
- HLA.
- RMI.
- (Nexus object for collection of D-OMAR agents.)
- (Simple Java Method calls.)
GTE-I / BBN Technologies
Distributed-OMAR
48Distributed-OMAR Architecture Summary/Status
Recap
- Single Common-Lisp source code for all system
configurations - At most, involves a recompile.
- Single Java source code (exclusive of
application-specific Cap). - Class files (binaries) Run anywhere.
GTE-I / BBN Technologies
Distributed-OMAR
49Distributed-OMARReconfiguring a Lisp System as
a Hybrid Lisp/(Java) Component
Nichael Cramer 17 Nov 1998
GTE-I / BBN Technologies
50Appendix 1ObjectStream Structure
- ObjectStream class
- Supports socket-based read/write bytes
operations. - Supports serialization API.
- (read-object ltobjstreamgt)
- (write-object ltobjstreamgt ltobjectgt)
GTE-I / BBN Technologies
Distributed-OMAR
51Appendix 1ObjectStream Structure
- ObjStreamParser object
- Passed as argument to ObjStream.
- Governs details of translation in reads/writes in
serialization.
GTE-I / BBN Technologies
Distributed-OMAR
52Appendix 1OMAR Parser Class Structure
- base-parser
- (Error-handling basic read/write operations.)
- core-parser
- (strings, numbers, arrays, etc.)
- lisp-parser
- (Cons cells lists etc.)
- omar-event-parser
- (omar-events concept-structures etc.)
GTE-I / BBN Technologies
Distributed-OMAR
53Appendix 2ObjectStream as Eval-Server
- Message-passing not the only protocol
ObjectStream. - Java calls to Lisp can be written as
(stringified) Lisp form.
GTE-I / BBN Technologies
Distributed-OMAR
54Appendix 2ObjectStream as Eval-Server
- Eval-Server
- Use existing serialization protocol.
- Java submits request as string into Lisp.
- submitEval((setq mainval ( 3 substate)))
- Lisp performs a read-from-string.
- Returns (serialized) result value to Java.
GTE-I / BBN Technologies
Distributed-OMAR
55Appendix 3DrawStream/Procedure Browser
- Tool for graphically viewing structures of and
communications between procedures in D-OMAR
models. - Multiple Views
- Super-/sub-procedures (who calls, etc.)
- Signals generated/waited-for
- Procedure view.
GTE-I / BBN Technologies
Distributed-OMAR
56Appendix 3DrawStream/Procedure Browser
- Super/Sub-procedures and Signal views are
graph-based. - Java Gui requests data-structure to view.
- Lisp prepares the data-structure and ships it off
(via serialization) to Java. - Java uses standard graphing display code to
display the results.
GTE-I / BBN Technologies
Distributed-OMAR
57Appendix 3DrawStream/Procedure Browser
- Procedure view (uses DrawStream)
- View is laid-out and drawn in Lisp.
- Uses pre-existing Lisp display code.
- Display code draws to a DrawStream object.
- DrawStream encodes drawing commands as a sequence
of bytes.
GTE-I / BBN Technologies
Distributed-OMAR
58Appendix 3DrawStream/Procedure Browser
- Representation (sequence of bytes) is shipped to
Java. - Currently as an Array (in an Event).
- Alternatively Live byte-stream.
- Bytes are rendered in Java.
- DrawStreamCanvas.
- Decodes byte-sequence representation.
GTE-I / BBN Technologies
Distributed-OMAR
59Appendix 3DrawStream/Procedure Browser
- Gestures are handled
- Transmit screen location back to Lisp.
- Lisp returns any appropriate object.
- Note that the DrawStream object and the Java
DrawStreamCanvas class are write once
constructs which can be re-used with other Lisp
displays.
GTE-I / BBN Technologies
Distributed-OMAR
60Appendix 3DrawStream/Procedure Browser
GTE-I / BBN Technologies
Distributed-OMAR
61Distributed-OMAR
Additional information http//www.sover.net/nich
ael/misc/ Nichael Cramer 17 Nov 1998
GTE-I / BBN Technologies
62Distributed-OMARReconfiguring a Lisp System as
a Hybrid Lisp/(Java) Component
Nichael Cramer 17 Nov 1998
GTE-I / BBN Technologies
63Why not simply Corba? (foreign-function calls?,
etc?)
- When we started, no Lisp Corba binding.
- This has changed/is changing.
- But, for example, no signal servicing.
- Dont want to be Corba-specific.
- I.e no multiple versions to run with
- HLA, DCOM, RMI
GTE-I / BBN Technologies
Distributed-OMAR
64Why not simply Corba? (foreign-function calls?,
etc?)
- Lightweight
- Dont need an ORB to (e.g.) just run a GUI.
- D-OMAR has a single protocol to communicate with
all external processes. - Works with any CommonLisp
- (Provided it supports sockets.)
GTE-I / BBN Technologies
Distributed-OMAR
65Why not simply Corba? (foreign-function calls?,
etc?)
- By moving the burden into (Java), we can
automatically leverage any Java-based middle-ware
support. - In short, we are betting that Java will always
have better support for middleware, GUIs, etc.
GTE-I / BBN Technologies
Distributed-OMAR
66Why not simply Corba? (foreign-function calls?,
etc?)
- Finally, if the decision is made to convert
D-OMAR to a Corba base, we only have to re-write
the Connection protocol. - Modular design ensures a (relatively -) painless
transition.
GTE-I / BBN Technologies
Distributed-OMAR
67Distributed-OMARReconfiguring a Lisp System as
a Hybrid Lisp/(Java) Component
Nichael Cramer 17 Nov 1998
GTE-I / BBN Technologies
68Distributed-OMARReconfiguring a Lisp System as
a Hybrid Lisp/(Java) Component
Nichael Cramer 17 Nov 1998
GTE-I / BBN Technologies
69Example Command-Line Master
gt Scenario select ATC gt Scenario run gt
Report time 0. gt Report time 5. gt Report
Event (Comm AC-11 ATC-23) gt Report time 10. gt
Report Event (ATC-23 Acknowledge)
Command Line Master
Core Omar
GTE-I / BBN Technologies
70Application GUI Connection
Radar Display
Control GUI Connection
Distributed Master
Core Omar
ATC Control Panel
Application GUI Connection
Cockpit Display
GTE-I / BBN Technologies
71Control GUI Connection -Java (continued)
- Events function as high-level request for
state-change. - Independent of nature of Subscriber.
- No restrictions on how Subscriber uses events.
- I.e. it can do what it wants with events.
GTE-I / BBN Technologies
Distributed-OMAR
72D-OMAR/HLA Architecture
- Federate-Cap functions as conduit into/from
Core-OMAR module. - Because Cap has no application-specific
information, it can be reused. - All modeling behavior is handled within Core-OMAR.
GTE-I / BBN Technologies
Distributed-OMAR
73D-OMAR/HLA Architecture
External Federate 1
Federate Cap
Distributed Master
Core OMAR
R T I
C External Connection
External Federate 2
LISP
C
GTE-I / BBN Technologies
Distributed-OMAR