Title: Taems%20/%20MASS%20Technical%20Overview
1Taems / MASS Technical Overview
- Bryan Horling
- University of Massachusetts
- bhorling_at_cs.umass.edu
Régis Vincent SRI vincent_at_ai.sri.com
2Overview
- Taems - a language for modeling the quantitative
behavior of tasks and task interactions - MASS - a simulation environment that uses Taems
as the basis of agent activity
3Source and Licensing
- Java implementations of Taems and MASS are
available - Java 1.3
- Source is included
- Apache 2.0 License
- http//mas.cs.umass.edu/download.html
- (Forthcoming from GITI as well)
4Documentation
- Implementation
- JavaDoc APIs available online
- Topic-specific HOWTOs online
- Sample code in JAF distribution
- These slides
- Concepts
- Taems white paper
- Various publications (see Taems and MASS
webpages) - http//mas.cs.umass.edu/
5High-Level Overview
Agent
Agent
Agent
New Taems Structure Action Started Communication
Action Completed Communication
MASS
Manages Time Simulates Method Execution Enforces
Taems Semantics Reports Activity Results
6Taems at a glance
- 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
7Inside a Taems Structure
- Directed graph, made up of nodes
- Each node has a set of defined properties
- 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
8Constructing Taems Structures
(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) )
9Constructing Taems Structures
- Visual Editor - taemsview
10Pre-Taems
- Preprocessed Taems (ptaems)
- Taems template language
- Parameterizable, dynamically generate many
structures from one specification - Conceptually similar to C preprocessor directives
- Variables (define)
- Control structures (e.g., if, while)
- Functions (e.g., sum, prod, random_float)
foo.ptaems
foo.ttaems
foo
parameters
preprocess
parse
11Reading Taems
- Taems library includes a parser
- ReadTTaems reader new ReadTTaems(null)
- Taems task reader. readTTaems(stream)
- pTaems
- PreProcessorParser parser new
PreProcessorParser(stream) - PreProcessor preprocessor parser.Input()
- Hashtable parameters new Hashtable()
- String processed preprocessor.toTTaems(parameter
s) - Taems task readTTaems(new StringReader(processed
)) - Parsers are created by JavaCC, source is included
12Writing Taems
- Taems object may be converted to its textual
representation - For communication, storage, etc.
- String text task.toString()
- String text task.toTTaems(Taems.V1_0)
- Individual nodes may be stringified similarly
- Taems object is also serializable
13Visualizing Taems
- Taems object is a JPanel
- Simply add it to a frame to visualize
- JFrame frame new JFrame("Taems Task
Structure") - frame.getContentPane().add(task,
BorderLayout.CENTER) - frame.setVisible(true)
- Display is updated as changes are made
- Can also edit using this interface (danger!)
14Accessing Nodes
- 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.getNodes()
e.hasMoreElements() ) - Node node (Node)e.nextElement()
- if (node instanceof Task ((Task)node).isTaskG
roup()) n - // end countTaskGroups
- Graph structure exists in the relationships each
Node possesses, e.g., - Task.getSubtasks()
- TaskBase.getSupertasks()
- Interrelationship.getFrom() getTo()
15Modifying Nodes
- All of the structures characteristics can be
modified using accessors - Task.setQAF()
- Method.addOutcome()
- Interrelationship.setEndpoints()
- Resource.setState()
- Node.setAgent()
- Interrelationship.setActive()
- ConsumesInterrelationship.setConsumes()
- etc
- These can be used to read and change structural
properties
16Analyzing Taems
- Finding classes of nodes
- Enumeration e t.findNodes(new Resource())
- while (e.hasMoreElements())
- Resource r (Resource)e.nextElement()
- // end resourceWalker
- Enumeration e t.findNodes(new Node(Foobar))
- while (e.hasMoreElements())
- Node r (Node)e.nextElement()
- // end foobarFinder
- Automatic state propagation
- (e.g., cost, quality, duration)
- method.setCurrentQuality()
- taskgroup.getCurrentQuality()
17Things not covered here
- Schedule, ScheduleElement
- For storing activity schedules
- Commitments
- Represent results of coordination
- Attributes
- For tagging nodes with arbitrary data
- Nonlocal methods
- Actions that one cannot perform locally
- Merging Taems structures
- See Taems.unionTaems
18MASS
- Interface/GUI
- Demo
- Time/pulse driven
- Pulse cycle
- Scripting
19MASS GUI
20Features
- Resources modeling
- Scripting capabilities
- Separate actual and perceived states
- what the participants believe may not be true
- Time and Event based
- Logging
- Deterministic
- to allow for the re-testing of modified components
21Clock
- Centralized (at simulation controller)
- Discrete, pulse-based
- During each cycle
- 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
22Event Queue
- Event based system
- simulated execution
- message transfer
- environmental
- Events have both a start and duration time
- During each cycle
- the list of extant events is retrieved for that
time slot - each event is given a time slice to run in
events
1
2
3
4
1
2
time
3
4
5
23Scripting
- Highly customizable scripting language
- Format
- Script, ScriptClassName, ScriptSpecificName,
Data - Assertion, Assertion1ClassName, Data
-
- Assertion, Assertion3ClassName, Data
- Reaction, Reaction1ClassName, Data
-
- Reaction, Reaction2ClassName, Data
- Over 50 pre-defined scripts
- Assertion, AgentConnected, AgentWaterHeater
- Assertion, ResourceLevelCompare,
Resource1Kitchen_Temp, Opgt, Resource2LivingRoom
_Temp - Reaction, SendMessage, AgentWaterHeater,
Perfask, CWdisconnect, ControlTrue - Reaction, SendCommitment, Labeltests,
Importance30, MinQuality60, EarliestStartTime10
, Deadline20, TimeSatisfied450, ToAgent - Example
- Script, AndScript, Agent Disconnect Status,
- Assertion, NumAgentConnected, Oplt, Value5
- Assertion, Time, Opgt, Value10
- Reaction, Write, LineStopping Simulation!
24MASS Agents
- GITI/Grid Agent
- CoABS grid agent
- Interfaces to MASS
- Available shortly
- JAF (Java Agent Framework)
- Component-based agent framework
- Uses Taems
- Available at http//mas.cs.umass.edu
25BACKUP
26MASS Interface
- Hand-shake
- A-gtS (register sender ExampleAgent type
control content receiver simulator language
KQML) - S-gtA (tell sender simulator type control
content (Name ExampleAgent ) receiver
ExampleAgent language KQML) - Init
- S-gtA (tell sender simulator type control
content (RandomSeed 889210829049 ) receiver
ExampleAgent language KQML) - S-gtA (tell sender simulator type control
content (Time 0 ) receiver ExampleAgent
language KQML) - Pulsing
- S-gtA (tell sender simulator content (pulse)
type control reply-with (pulse) receiver
ExampleAgent language KQML) - A-gtS (reply sender ExampleAgent in-reply-to
pulse content (ack pulse) receiver simulator
language KQML)
27MASS Interface 2
- New TAEMS structure
- A-gtS (tell sender ExampleAgent content
(AddTaems.) receiver simulator language KQML) - Execution of method
- Activation
- Termination
- Query of resources
- S-gtA (reply sender simulator content (R1 value
min max) in-reply-to ??? receiver ExampleAgent
type control language KQML) - Reset
- S-gtA (ask sender simulator content (reset)
receiver ExampleAgent type control reply-with
(reset) language KQML)
28MASS Interface 3
- Inter-agent communications
- Point-to-point
- Broadcast