Taems MASS Technical Overview Bryan Horling University of
Taems / MASS Technical Overview Bryan Horling University of Massachusetts bhorling@cs. umass. edu Régis Vincent SRI vincent@ai. sri. com
Overview n Taems - a language for modeling the quantitative behavior of tasks and task interactions n MASS - a simulation environment that uses Taems as the basis of agent activity
Source and Licensing n Java implementations of Taems and MASS are available n Java 1. 3+ Source is included n Apache 2. 0 License n n http: //mas. cs. umass. edu/download. html (Forthcoming from GITI as well)
Documentation n Implementation Java. Doc APIs available online n Topic-specific HOWTOs online n Sample code in JAF distribution n These slides n n Concepts Taems white paper n Various publications (see Taems and MASS webpages) n http: //mas. cs. umass. edu/
High-Level Overview Agent New Taems Structure Action Started Communication Agent Action Completed Communication MASS Manages Time Simulates Method Execution Enforces Taems Semantics Reports Activity Results
Taems at a glance n n n Task groups represent goals Tasks represent a sub-goal Methods are executable primitives Resources model resource state Interrelationships model interactions between nodes QAFs specify how quality is accrued from sub-tasks
Inside a Taems Structure n n Directed graph, made up of nodes Each node has a set of defined properties n n n Methods have outcomes Interrelationships define effect, etc. These fields are explained in the white paper method name Vacuum-Floor agent Me supertasks Clean-Floor quality_distribution 5. 0 1. 0 duration_distribution 10. 0 1. 0 cost_distribution 0. 0 1. 0 facilitates name Facilitates_1 from Vacuum-Floor to Wash-Floor quality_power 0. 3 1. 0 duration_power 0. 2 1. 0 cost_power 0. 0 1. 0 nodes
Constructing Taems Structures n Textual Taems (ttaems) (spec_agent (label Me) ) (spec_task_group (label Clean-Kitchen) (agent Me) (subtasks Clean-Floor Wash-Counters Put-Away-Dishes) (qaf q_sum) ) (spec_task (label Clean-Floor) (agent Me) (subtasks Vacuum-Floor Wash-Floor) (supertasks Clean-Kitchen) (qaf q_max) ) (spec_task (label Put-Away-Dishes) (agent Me) (subtasks Slow-And-Safe Quick-And-Dirty) (supertasks Clean-Kitchen) (qaf q_exactly_one) ) (spec_method (label Vacuum-Floor) (agent Me) (supertasks Clean-Floor) (outcomes (Outcome_1 (density 1. 0) (quality_distribution 5. 0 1. 0) (duration_distribution 10 1. 0) (cost_distribution 0 1. 0) ) (spec_method (label Wash-Floor) (agent Me) (supertasks Clean-Floor) (outcomes (Outcome_1 (density 1. 0) (quality_distribution 7. 0 1. 0) (duration_distribution 15 1. 0) (cost_distribution 0 1. 0) )
Constructing Taems Structures n Visual Editor - taemsview
Pre-Taems n Preprocessed Taems (ptaems) n n n Taems template language Parameterizable, dynamically generate many structures from one specification Conceptually similar to C preprocessor directives n n n Variables (#define) Control structures (e. g. , #if, #while) Functions (e. g. , #sum, #prod, #random_float) parameters foo. ptaems preprocess foo. ttaems parse foo
Reading Taems n Taems library includes a parser: Read. TTaems reader = new Read. TTaems(null) Taems task = reader. read. TTaems(stream); n p. Taems: Pre. Processor. Parser parser = new Pre. Processor. Parser(stream); Pre. Processor preprocessor = parser. Input(); Hashtable parameters = new Hashtable(); String processed = preprocessor. to. TTaems(parameters); Taems task = read. TTaems(new String. Reader(processed )); n Parsers are created by Java. CC, source is included
Writing Taems n Taems object may be converted to its textual representation n For communication, storage, etc. String text = task. to. String() String text = task. to. TTaems(Taems. V 1_0) Individual nodes may be stringified similarly n Taems object is also serializable n
Visualizing Taems n Taems object is a JPanel n Simply add it to a frame to visualize JFrame frame = new JFrame("Taems Task Structure"); frame. get. Content. Pane(). add(task, Border. Layout. CENTER); frame. set. Visible(true); Display is updated as changes are made n Can also edit using this interface (danger!) n
Accessing Nodes n n Node is the base class for most Taems structures (tasks, methods, IRs, resources, etc. ) The Taems object itself is a container for Node objects (among other things) for (Enumeration e = task. get. Nodes(); e. has. More. Elements(); ) { Node node = (Node)e. next. Element(); if (node instanceof Task && ((Task)node). is. Task. Group()) n++; } // end count. Task. Groups n Graph structure exists in the relationships each Node possesses, e. g. , Task. get. Subtasks() Task. Base. get. Supertasks() Interrelationship. get. From() & get. To()
Modifying Nodes n All of the structure’s characteristics can be modified using accessors Task. set. QAF() Method. add. Outcome() Interrelationship. set. Endpoints() Resource. set. State() Node. set. Agent() Interrelationship. set. Active() Consumes. Interrelationship. set. Consumes() etc… n These can be used to read and change structural properties
Analyzing Taems n Finding classes of nodes Enumeration e = t. find. Nodes(new Resource()); while (e. has. More. Elements()) { Resource r = (Resource)e. next. Element(); } // end resource. Walker Enumeration e = t. find. Nodes(new Node(“Foobar”)); while (e. has. More. Elements()) { Node r = (Node)e. next. Element(); } // end foobar. Finder n Automatic state propagation n (e. g. , cost, quality, duration) method. set. Current. Quality() taskgroup. get. Current. Quality()
Things not covered here… n Schedule, Schedule. Element n n Commitments n n For tagging nodes with arbitrary data Nonlocal methods n n Represent results of coordination Attributes n n For storing activity schedules Actions that one cannot perform locally Merging Taems structures n See Taems. union. Taems
MASS Interface/GUI n Demo n Time/pulse driven n Pulse cycle n Scripting n
MASS GUI Global Task Structure Event queue Script queue Display Control Environment Resources
Features n n n Resources modeling Scripting capabilities Separate “actual” and “perceived” states n n what the participants believe may not be true Time and Event based Logging Deterministic n to allow for the re-testing of modified components
Clock n n n Centralized (at simulation controller) Discrete, pulse-based During each cycle n n a pulse is sent to each attached client each client converts the pulse to actual CPU time upon completion, each client responds to the simulator when all responses have been received, simulation continues start finished Agent Manager
Event Queue n Event based system n n n simulated execution message transfer environmental Events have both a start and duration time During each cycle n n the list of extant events is retrieved for that time slot each event is given a time slice to run in events 1 1 time 2 3 4 5 2 3 4
Scripting n Highly customizable scripting language n Format: Script, Script. Class. Name, Script. Specific. Name, Data Assertion, Assertion 1 Class. Name, Data … Assertion, Assertion 3 Class. Name, Data Reaction, Reaction 1 Class. Name, Data … Reaction, Reaction 2 Class. Name, Data n Over 50 pre-defined scripts: Assertion, Agent. Connected, Agent: Water. Heater Assertion, Resource. Level. Compare, Resource 1: Kitchen_Temp, Op: >, Resource 2: Living. Room_Temp Reaction, Send. Message, Agent: Water. Heater, Perf: ask, CW: disconnect, Control: True Reaction, Send. Commitment, Label: tests, Importance: 30, Min. Quality: 60, Earliest. Start. Time: 10, Deadline: 20, Time. Satisfied: 450, To. Agent: * n Example: Script, And. Script, Agent Disconnect Status, Assertion, Num. Agent. Connected, Op: <, Value: 5 Assertion, Time, Op: >, Value: 10 Reaction, Write, Line: Stopping Simulation! Reaction, Stop. Sim
MASS Agents n GITI/Grid Agent Co. ABS grid agent n Interfaces to MASS n Available shortly n n JAF (Java Agent Framework) Component-based agent framework n Uses Taems n Available at http: //mas. cs. umass. edu n
BACKUP
MASS Interface n Hand-shake: n n n Init: n n n A->S: (register : sender Example. Agent : type control : content : receiver simulator : language KQML) S->A: (tell : sender simulator : type control : content (Name Example. Agent ) : receiver Example. Agent : language KQML) S->A: (tell : sender simulator : type control : content (Random. Seed 889210829049 ) : receiver Example. Agent : language KQML) S->A: (tell : sender simulator : type control : content (Time 0 ) : receiver Example. Agent : language KQML) Pulsing: n n S->A: (tell : sender simulator : content (pulse) : type control : replywith (pulse) : receiver Example. Agent : language KQML) A->S: (reply : sender Example. Agent : in-reply-to pulse : content (ack pulse) : receiver simulator : language KQML)
MASS Interface 2 n New TAEMS structure: n n Execution of method: n n n Activation: Termination Query of resources: n n A->S: (tell : sender Example. Agent : content (Add. Taems…. ) : receiver simulator : language KQML) S->A: (reply : sender simulator : content (R 1 value min max) : inreply-to ? ? ? : receiver Example. Agent : type control : language KQML) Reset: n S->A: (ask : sender simulator : content (reset) : receiver Example. Agent : type control : reply-with (reset) : language KQML)
MASS Interface 3: Inter-agent communications: Point-to-point n Broadcast n
- Slides: 28