FrameSetOverview_Mar07

Download Report

Transcript FrameSetOverview_Mar07

Cougaar FrameSet Overview
March 2, 2007
Rich Shapiro, John Zinky
1
FrameSet Knowledge Representation
•
Java Objects are code generated
– Frames and relationships defined using XML
– Support multiple Java interfaces
•
•
•
•
•
Slot inference (Real-time)
–
–
–
–
•
Cougaar Blackboard,
JESS Shadow Facts,
Java Beans
Applet viewer
Type (is-a)
Containment (has-a)
Visitor Pattern (composed-of)
Aggregation (summary-of)
Relationships are also Frames
– Benefits from Frame inheritance
•
Meta-data tags
Host
Equip
Process
Appl
Object
Class
Thing
Type inheritance
Containment inheritance
Frame
name value
name value
name value
– 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
Relationship
parent-name value
child-name value
2
Runtime (Frame Sets)
FrameSet
Spec
(XML)
FrameSet
Instances
(XML)
•
•
•
•
•
•
FrameSet
Read/Write
Create/Delete
Indexes
Frames
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
Blackboard
Clients
Jess
Clients
Beans
Clients
3
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.
4
Framesets Code Generator
Jess Rule
Engine
Jess
DefClass
Applet
GUI
Table
GUI
OpenMap
GUI
Java Applet
Structs
Prototype
Spec.xml
Prototype
Spec.uml
Code
Gen
Prototype
Spec.dtd
ArgoUml
Prototype
Java Classes
FrameSet
Loader
Instance
Spec.xml
Cougaar Black Board
Metrics
Service
RDF to
FrameSet
Inter-agent
Coordination
5
Cougaar Plugins Add/Modify/Delete Frames
Situation
Inference
Rules
GUI
Display
SASSI
SASSI
Optimizer
Optimizer
Jess
Engine
GUI
Engine
Optimizer
Wrapper
Blackboard
FrameSet
Situation
Status
Sensor
Policies
Control
Actuator
Managed System
6
Frames Displayed via Swing GUI
•
•
•
•
Table View
X-Y Graphs
Pie Chart
GIS Map
7
Browser Based Java Applet
Blackboard
FrameSet
Indexes
Browser
Applet
Filter
view
Frames
Prototype
Spec.xml
•
Display Code
Update
Plugin
Change
records
HTTP
Struct
Code
Gen
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)
8
JESS Rule Engine Processes Frames
Agent Domain Processing
Jess Rule code
Procedural code
LHS
RHS
Domain Processing
Patterns
Trigger
Assert
Retract
Domain Routines
Domain Objects
Code Libraries
Blackboard Partitions
managed by
Coordination Artifacts
Partitioned Blackboard
Coordination with
External Systems
Coordination with
Physical Environment
Agents
Concentrate
on domain
processing
Coordination with
Peer Agents
Real-Time Knowledge Feeds
9
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.
10
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.
11
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,
12
Demo Monitors the Cougaar Society Itself
•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
• 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.
13
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
14
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
15
Focus on Knowledge Sharing Among Agents
Knowledge
Rep A
“Model”
•
Tracking
Translation
Transfer
Knowledge
Rep B
“View”
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
16
QoS-Adaptive Translation Changes the
Translation Mechanics to Match the Situation
QoS-Adaptive Translation
Deltas
Change
Detection
Change
Reconstruction
Transfer Constraints
Host capacity
Process
Object
Method
Method
Object
Class
Method
Method
Load
Latency= Load / Capacity
Latency
• 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
17
Example: Not One Transfer Algorithm
Latency= Load / Capacity
• 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
18
Relationships Vs Slot Value
Pointers
Frame: F1
P Relationship:
Frame F2
C Relationship:
Frame F1
P Relationship: F1
Frame F2
C Relationship:F2
Frame F1
Join
Relationship: R1
Parent: F2
Child: F1
Frame F2
• Relationships are bi-directional
• Binding attribute, name, id, ref
• Relationship binding cache is stored in the FrameSet
not the Frame
19
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
20
Slot Systemic Metadata
•
•
•
•
•
•
Immutable
Member
Warn
notify-blackboard
notify-listeners
inheritable-through
– all
– prototype-only
• transient
21
FrameSet Indexing
• Frame ID
– Hash table
• Relationship
– Frames relationships
– Parent and Child frames
22
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>
Type
Inheritance
Containment
Inheritance
<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>
Visitor
Accessor
Aggregator
Accessor
Relationship
<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>
Visitor
Specification
23
Example: XML Instance Specification
Process
analyzer1
Link
Source
Link
analyzer1-sensor1
Link
Destination
Process
sensor1
Process At Location
Process At Location
Location
greenwich
Location
paris
<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"/>
24
Realtime Knowledge Sharing
Automation Architecture
Specify
Semantic
Translation
Sensor
Ontology
Expected
Usage Patterns
Sensor
Data Structure
Mapping
Semantic
Mapping
Application
Ontology
Application
Data Structure
Mapping
Design
Knowledge Rep
Knowledge
Representation
Schema
Code
Generator
Sensor
Instances/
Changes
FrameSet
Indexes
Instances
Expected
Usage Patterns
Design
Knowledge Rep
Design
Data Structure
Translation
Translation
Rules
Coordination
Artifact
System Resource Constraints
Knowledge
Representation
Schema
Code
Generator
FrameSet
Indexes
Instances
Application
Change
Notification
25
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
26