260 likes | 278 Views
Cougaar Frameset is a Java-based system for knowledge representation and real-time inference. It uses XML to define frames and relationships, supports multiple Java interfaces, and provides features like slot inference, type and containment inheritance, visitor pattern, and aggregation. Cougaar Frameset also includes tools for code generation, blackboard management, and GUI display.
E N D
Cougaar FrameSet Overview March 2, 2007 Rich Shapiro, John Zinky
FrameSet Knowledge Representation Host Equip • Java Objects are code generated • Frames and relationships defined using XML • Support multiple Java interfaces • Cougaar Blackboard, • JESS Shadow Facts, • Java Beans • Applet viewer • Slot inference (Real-time) • Type (is-a) • Containment (has-a) • Visitor Pattern (composed-of) • Aggregation (summary-of) • Relationships are also Frames • Benefits from Frame inheritance • Meta-data tags • Defined at compile-time • Slots, frames, framesets • Example Slot meta-data • Type, default-value, units, path, doc, member, warn, immutable, notify-blackboard, notify-listeners, transient Process Appl Thing Object Class Type inheritance Containment inheritance Frame name value name value name value Relationship parent-name value child-name value
Build indexes to resolve relationship Queries and iterators over frames Change Callbacks Slot Inference (type, containment, visitor, aggregation) Recalculation regulated by meta data Recalculation bundled to handle massive changes Hooks into infrastructure (Cougaar, Jess, Beans, GUI) Persistence Relays Subscriptions Extended reflective interface on FrameSets, Frames, and Slots Runtime (Frame Sets) Read/Write Blackboard Clients FrameSet Spec (XML) FrameSet Create/Delete Indexes Jess Clients FrameSet Instances (XML) Frames Beans Clients
Real Time Inference • Prototype (on frame) • Use Java Class system • No Dynamic default slot inheritance (future?) • Containment (on frame) • Detects add, delete, change of slot value • Calculated by Property change • Visitor (on slot) • Follows a path of relationships to a slot • Update Plugin detects changes to relationships and slots along path • Aggregation (on slot) • Follows relationships to children • Update Plugin detects changes slots and add/delete of relationships • Aggregate calculated by user-defined Java function.
Framesets Code Generator Jess Rule Engine Applet GUI Table GUI OpenMap GUI Jess DefClass Java Applet Structs Prototype Spec.xml Code Gen Cougaar Black Board Prototype Java Classes Prototype Spec.dtd FrameSet Loader Metrics Service RDF to FrameSet Inter-agent Coordination Prototype Spec.uml Instance Spec.xml ArgoUml
Managed System Cougaar Plugins Add/Modify/Delete Frames Situation Inference Rules SASSI Optimizer GUI Display SASSI Optimizer Optimizer Jess Engine GUI Engine Optimizer Wrapper Blackboard FrameSet Situation Policies Control Actuator Status Sensor
Frames Displayed via Swing GUI • Table View • X-Y Graphs • Pie Chart • GIS Map
Browser Based Java Applet • Code Generator creates light-weight projections of Frames • Struct objects are loaded into client-side java program running in a user’s browser • Struct objects are kept in sync with server-side FrameSet • The applet-runtime libraries are purged of dependencies on other jars. • Code Generator could use the same architecture to support AJAX • (e.g. Goggle map) Blackboard Browser FrameSet Applet Filter view Indexes Display Code Update Plugin Frames Change records Struct HTTP Prototype Spec.xml Code Gen
JESS Rule Engine Processes Frames Agent Domain Processing Jess Rule code Procedural code LHS Patterns RHS Trigger Assert Retract Domain Processing Domain Routines Domain Objects Code Libraries Agents Concentrate on domain processing Blackboard Partitions managed by Coordination Artifacts Partitioned Blackboard Coordination with External Systems Coordination with Physical Environment Coordination with Peer Agents Real-Time Knowledge Feeds
FrameSet Definitions Displayed as UML • FrameSet code generator outputs a subset of the UML exchange file • ArgoUML can input and display the FrameSet definition graphically • Useful for debugging and maybe documentation.
FrameSet Servlet can inspect Frames • Cougaar blackboard holds all the frames. • Queries can be based on frame kind and slot values • Frames slot values can be modified. • Metric values <0.0,0.8> have both a value and a confidence.
Relationships are also frames • Relationships can change dynamically. • Slot inheritance is recalculated, when relationships change. • One changing in a relationship can change multiple slot values (through inheritance) • Relationship frames are easy to transmit,
Demo Monitors the Cougaar Society Itself • A model of the Cougaar society is created in a FrameSet. • The status values are updated in realtime using the Cougaar Metrics service • Frame Debug GUI shows view of society model. • TopologyDemo Agents: • Monitor agent containing a FrameSet on its Cougaar blackboard • Source1 and Sink1 agents ping each other as fast as they can • NODE1 and NODE2 are control agents for Java process • NameServer agent supplies naming for the society
FrameSet Debug GUI can Inspect Frames • Brown slots are inherited from the container. • White slots are inherited from the frame’s prototype (IsA relationship) • Containment hierarchy is on the left column • Type hierarchy is in the middle column
FrameSet GUI can Inspect Prototypes • Yellow Slot show the slots defined by this prototype. • Default values are defined, which can be over written by the prototype’s children
Extensions to Cougaar Agent Infrastructure Frame Sets to store knowledge Coordination Artifacts to transfer knowledge Forward-Chaining Rules detect patterns in knowledge Benefits Exploits meta-data to help: Generate efficient Java Classes Change notification integrated into Blackboard, Jess, Java Beans, QoS-adaptive Transfer and Translation Run time debugging via servlet and GUIs Separation of Agent Domain processing from Coordination Range of tradeoffs for Access Time vs Storage Space Focus on Knowledge Sharing Among Agents Tracking Translation Transfer Knowledge Rep B Knowledge Rep A “Model” “View”
QoS-Adaptive Translation Changes the Translation Mechanics to Match the Situation QoS-Adaptive Translation • Translation Should take into account • Structure of starting and ending data structures • Probability and frequency that structures will change • The constraints of the transfer path Deltas Change Reconstruction Change Detection Transfer Constraints Host Object capacity Process Latency Object Class Method Method Method Method Load Latency= Load / Capacity
Example: Not One Transfer Algorithm • Where should the division be done? • What if, Load is fixed and Capacity changes • What if, the Load changes and Capacity is fixed • What if, Capacity is really multiple parameters with different change rates • What if, network connection slow • What if, destination or source computer is slow Latency= Load / Capacity
Relationships Vs Slot Value Pointers Frame: F1 P Relationship: • Relationships are bi-directional • Binding attribute, name, id, ref • Relationship binding cache is stored in the FrameSet not the Frame Frame F2 C Relationship: Frame F1 P Relationship: F1 Frame F2 C Relationship:F2 Join Frame F1 Relationship: R1 Parent: F2 Child: F1 Frame F2
Slot Domain Meta Data • Default Value • Units • Type • Doc • Future • Value constraints • Formulas (like aggregation, but with multiple dependant slots, value relative) Like QuO RSS
Slot Systemic Metadata • Immutable • Member • Warn • notify-blackboard • notify-listeners • inheritable-through • all • prototype-only • transient
FrameSet Indexing • Frame ID • Hash table • Relationship • Frames relationships • Parent and Child frames
Example: Frame Specification <prototype name="processingLayerThing" prototype="staticThing"> <slot name="layer" type="String" default-value="Processing” immutable“true”/> </prototype> <prototype name="location" prototype="geoLayerThing"> <slot name="lat" type="float" default-value="0.0f"/> <slot name="lon" type="float" default-value="0.0f"/> </prototype> <prototype name="process" prototype="processingLayerThing” container="location"> <slot name="maxQueue" type="float" default-value="200.0f"/> </prototype> <prototype name="link" prototype="processingLayerThing"> <slot name="maxBandwidth" type="float" default-value="10.0f"/> <slot name="srcLat" type="Float" path="linkSrcLat"/> <slot name="color" type="java.awt.Color" default-value="java.awt.Color.BLUE" inheritable-through="prototype-only"> <aggregate-by relation="processCapacityRepresents" aggregator="ColorFromStatus" related-slot="status"/> </slot> </prototype> <relation-prototype name="linkSource" prototype="relationship" parent-prototype="process" child-prototype="link"> </relation-prototype> <relation-prototype name="processAtLocation" prototype="contains" parent-prototype="location" child-prototype="process"> </relation-prototype> <path name="linkSrcLat"> <fork relation="linkSource" role="parent"/> <fork relation="processAtLocation" role="parent"/> <slot-reference name="lat"/> </path> Type Inheritance Containment Inheritance Visitor Accessor Aggregator Accessor Relationship Visitor Specification
Example: XML Instance Specification <location id=”greenwich" lat="50.0f" lon="0.5f"/> <location id=”paris" lat=”48.9f" lon=”2.3f"/> <process id="sensor1" status=“up”/> <process id=”analyzer1" status=“down”/> <link name=”analyzer1-sensor1"/> <processAtLocation parentValue=”greenwich" childValue="sensor1"/> <processAtLocation parentValue=”paris" childValue=”analyzer1"/> <linkSource parentValue=”analyser1" childValue=”analyzer1-sensor1"/> <linkDestination parentValue=”sensor1" childValue=”analyzer1-sensor1"/> Process analyzer1 Process sensor1 Link analyzer1-sensor1 Link Source Link Destination Process At Location Process At Location Location greenwich Location paris
Specify Semantic Translation Sensor Ontology Application Ontology Sensor Data Structure Mapping Application Data Structure Mapping Expected Usage Patterns Expected Usage Patterns Semantic Mapping Design Knowledge Rep Design Knowledge Rep Design Data Structure Translation Knowledge Representation Schema Knowledge Representation Schema Code Generator Code Generator Translation Rules FrameSet Indexes Instances FrameSet Indexes Instances Sensor Instances/ Changes Application Change Notification Coordination Artifact System Resource Constraints Realtime Knowledge SharingAutomation Architecture
When To Use FrameSets • Real time models of physical world • Containment first class • Change notification • Several kinds (but not yet “adaptable”) • Inference Engine (Jess) • Expand raw input • Translation between Knowledge Representations • Built in Views • GUIs (applets, openmap) • External Tools (Beans, Jess) • Data Structures for OWL Graphs (FUTURE) • Input Translation • Output Translation