740 likes | 837 Views
Distributed-OMAR: Reconfiguring a Lisp System as a Hybrid Lisp/(Java) Component. Nichael Cramer 17 Nov 1998. GTE-I / BBN Technologies. The OMAR System. Additional information: Stephen Deutsch ( sdeutsch@bbn.com ). http://www.sover.net/~nichael/misc/ (Papers available at front.).
E N D
Distributed-OMAR:Reconfiguring a Lisp System as a Hybrid Lisp/(Java) Component Nichael Cramer 17 Nov 1998 GTE-I / BBN Technologies
The OMAR System • Additional information: • Stephen Deutsch (sdeutsch@bbn.com). • http://www.sover.net/~nichael/misc/ • (Papers available at front.) Distributed-OMAR GTE-I / BBN Technologies
The 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. Distributed-OMAR GTE-I / BBN Technologies
The 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. Distributed-OMAR GTE-I / BBN Technologies
The 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. Distributed-OMAR GTE-I / BBN Technologies
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. Distributed-OMAR GTE-I / BBN Technologies
Distributed-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. • OMAR’s internal modules should be able to run in a distributed manner as needed. Distributed-OMAR GTE-I / BBN Technologies
Distributed-OMAR Architecture: Design Goals • Flexible. • Usable with: • Broad range of systems. • Multiple “external” languages/platforms. • Assortment of middleware choices. • Stable as standards change. Distributed-OMAR GTE-I / BBN Technologies
Distributed-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. Distributed-OMAR GTE-I / BBN Technologies
Distributed-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. Distributed-OMAR GTE-I / BBN Technologies
Distributed-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. Distributed-OMAR GTE-I / BBN Technologies
Distributed-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.) Distributed-OMAR GTE-I / BBN Technologies
Distributed-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. Distributed-OMAR GTE-I / BBN Technologies
Distributed-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. Distributed-OMAR GTE-I / BBN Technologies
Distributed-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. Distributed-OMAR GTE-I / BBN Technologies
Core 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 Distributed-OMAR GTE-I / BBN Technologies
Core OMAR API • Well-defined, cleaned-up functional API protocol. • Commander • “Incoming” Commands • Listener • “Outgoing” Commands Core OMAR Distributed-OMAR GTE-I / BBN Technologies
OMAR Master • Implementation of the Core-OMAR API. • Governs communication with “outside world”. • More than one possible implementation. • Command-Line. • “OMAR Classic” Core OMAR Master Distributed-OMAR GTE-I / BBN Technologies
Distributed 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. Distributed-OMAR GTE-I / BBN Technologies
Sockets • Sockets: • Standard mechanism for inter-process communication. • TCP/IP based communication layer. • Common to virtually all platforms. Distributed-OMAR GTE-I / BBN Technologies
Serialization • 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.) Distributed-OMAR GTE-I / BBN Technologies
Message-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. Distributed-OMAR GTE-I / BBN Technologies
Distributed 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. Distributed-OMAR GTE-I / BBN Technologies
Distributed 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”. Distributed-OMAR GTE-I / BBN Technologies
Distributed-OMAR Component Control GUI Connection Core OMAR Distributed Master Java External Connection Application GUI Connection Distributed-OMAR GTE-I / BBN Technologies
Control GUI Connection Scenario Control Panel Core OMAR Distributed Master Control GUI Connection Procedure Browser LISP JAVA Concept Editor Distributed-OMAR GTE-I / BBN Technologies
Control 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. Distributed-OMAR GTE-I / BBN Technologies
Control 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”). Distributed-OMAR GTE-I / BBN Technologies
Control 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. Distributed-OMAR GTE-I / BBN Technologies
Control GUI Connection Scenario Control Panel Core OMAR Distributed Master Control GUI Connection Procedure Browser Concept Editor Distributed-OMAR GTE-I / BBN Technologies
Java External Connection Distributed-OMAR Architecture External D-OMAR Agent 1 Control GUI Connection Core OMAR Distributed Master External D-OMAR Agent 2 Application GUI Connection External Agent 3 Distributed-OMAR GTE-I / BBN Technologies
Communication 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. Distributed-OMAR GTE-I / BBN Technologies
Java External Connection Communication with External Agents External Agent 1 Communication Specific “Cap” External Agent 2 External Agent 3 Distributed-OMAR GTE-I / BBN Technologies
Communication with External Agents • Java Inter-Agent Communication: • Standard O-O method invocation. • RMI (Remote Method Invocation). • Corba • Voyager • HLA Distributed-OMAR GTE-I / BBN Technologies
OMAR Java External Connection Standard O-O Method Invocation External Agent 1 Standard Cap External Agent 2 Distributed-OMAR GTE-I / BBN Technologies
Java External Connection Remote Method Invocation (RMI) External Agent 1 RMI Cap Central Remote Server External Agent 2 Distributed-OMAR GTE-I / BBN Technologies
Java External Connection ORB Connection (e.g. Corba) External Component 1 Corba Cap O R B External Component 2 Distributed-OMAR GTE-I / BBN Technologies
Java External Connection Distributed-OMAR Architecture External D-Omar Agent 1 Control GUI Connection Core OMAR Distributed Master External D-Omar Agent 2 Application GUI Connection External Agent 3 Distributed Omar Component Remote Systems Distributed-OMAR GTE-I / BBN Technologies
OMAR Communication with Other Implementation Languages • Event-communication doesn’t depend on details of Event-Listener. • Connection only needs to support: • Sockets. • Serialization protocol. Distributed-OMAR GTE-I / BBN Technologies
OMAR Communication with Other Implementation Languages • Connection need not be written in Lisp or Java. • Nothing in Core-OMAR module changes. • An example: HLA. Distributed-OMAR GTE-I / BBN Technologies
D-OMAR/HLA Architecture External Federate 1 Control GUI Connection (Java) Federate Cap Core OMAR (Lisp) Distributed Master (Lisp) R T I C++ External Connection Application GUI Connection (Java) External Federate 2 Distributed-OMAR GTE-I / BBN Technologies
D-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. Distributed-OMAR GTE-I / BBN Technologies
Distributed-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) Distributed-OMAR GTE-I / BBN Technologies
Distributed-OMAR Architecture: Summary/Status (continued) • Standard Protocol for Connection to External Languages. • Current implementations in: • Java. • C++ (HLA). • Lisp. Distributed-OMAR GTE-I / BBN Technologies
Distributed-OMAR Architecture: Summary/Status (continued) • GUI implementation in Java. • Implementation of Java-based communication among collection of D-OMAR agents. • In Java: Runs “anywhere”. Distributed-OMAR GTE-I / BBN Technologies
Distributed-OMAR Architecture: Summary/Status (continued) • Current Platforms: • Windows NT/98. • Sun/Sparc. • (SGI) • (MacIntosh) Distributed-OMAR GTE-I / BBN Technologies
Distributed-OMAR Architecture: Summary/Status (continued) • Middlewares used. • Corba. • HLA. • RMI. • (Nexus object for collection of D-OMAR agents.) • (Simple Java Method calls.) Distributed-OMAR GTE-I / BBN Technologies
Distributed-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”. Distributed-OMAR GTE-I / BBN Technologies
Distributed-OMAR:Reconfiguring a Lisp System as a Hybrid Lisp/(Java) Component Nichael Cramer 17 Nov 1998 GTE-I / BBN Technologies
Appendix 1:ObjectStream Structure • ObjectStream class: • Supports socket-based read/write bytes operations. • Supports serialization API. • (read-object <objstream>) • (write-object <objstream> <object>) Distributed-OMAR GTE-I / BBN Technologies