Brahms Tutorial Overview of Brahms and Anatomy of a Brahms model
Brahms Multi-Agent Language Language Compiler Interactive Development Environment  Discrete-event Simulation Engine / Virtual Machine End-user Simulation Displays Simulation History Data Base Java-based Java API XML Runs on PC’s, Mac, Unix,  Linux ... ©  Maarten Sierhuis
Why Brahms? How people work together How people get to participate in a collaborative activity Role of the environment / use of space How communication happens The tools and artifacts used Individual motives, history and culture Not just problem-solving activities Simulation as a work system design/analysis tool Humans as social and collaborative agents Agents are situated, deliberative, cognitive and reactive Brahms is a general purpose modeling and simulation environment Understanding how people really work Developing multi-agent systems Theoretical Practical
Methodology:  Simulation to Implementation September 29, 2009 Implementation Future Ops Simulation Metrics & Data Current Ops Simulation Work System Design Workflow Tool Observation Operations
September 29, 2009 2 4 6 8 10 TRL 1992 1996 2000 2004 2008 NYNEX JPL JSC APOLLO VICTORIA JSC MOD OCAMS PROJECT BRAHMS – HISTORY OF APPLICATIONS ISS Surface Hab Mobile * Agents *  Supported ExPOC and Scout robot and crew in Sept’06 field test & Pogo Test in July ‘07 Aeronautics  CTFM PROJECT Brahms 24x7 in Mission Control
Types of Agent Languages
Overview of Brahms Agent Environment Agent Environment consists of the following: Brahms Agent Oriented Language Composer  for building models. (or Integrated Development Environment). Compiler  for compiling models. Virtual Machine  for simulating models. (or Simulation Engine). Agent Viewer  for viewing simulations.
Brahms Language Agent Oriented / BDI Agents are first-class citizens Agents are belief based Agents are intention based: Beliefs become intentions that trigger reasoning- and/or situation-action rules Organizational Modeling Agents can be modeled within an hierarchical member-of inheritance structure Object-based Objects can represent physical artifacts, data and concepts to reason with Integration of Java objects as data objects, Java activities and Java agents Geography-based Areas can be conceptual representations of locations Areas can be located within other areas, creating a hierarchical environment model Agents and objects can be located within an area
Agent Organization Group membership inheritance hierarchy Artifacts in the world as objects relevant in activities Tools and artifacts people use Class hierarchies Data as objects Information modeling Environment and its state Represented hierarchically as  areas  with  sub-areas Agents and objects are located within areas World State (facts vs. beliefs of agents) Detecting facts (reactive) Behavior as situated activities that take time Constraint on beliefs (workframes) Primitive or composite (decomposed) Goal-directed reasoning behavior as production rules within an activity that takes time Forward-chaining rules that take no time (thoughtframes) What Brahms Models Include
Anatomy of a Brahms Model Language Concepts Groups Agents Classes Objects AreaDefs Areas Paths Conceptual Classes Conceptual Objects Attributes  (OA-V) Relations  (ORO) Beliefs Facts Activities Workframes Preconditions Consequences Detectables Thoughtframes agent-based object-based geo-based object flows mental state/world state activity-based/ subsumption rule-based reactive inferences
Brahms   Agent Engine Beliefs (atomic  formulas) Desires (workframes thoughtframes  belief matching) Plans (workframes Thoughtframes activities) Intentions (workframes thoughtframes instantiations) input action output Beliefs-Desires-Intentions
Brahms: agent-oriented language Symbolic Discrete Event BDI-like System Production and Situation-action Rules WF1   C1 and C2 and C3 => Detect F4, Activity1(t), B5, B7 WF2  C4 => Activity2(t), B6 WF3  C5 and C6 and C7 => Detect F8, Activity1(t), F9 F1, F2, F4 ….. Workframe Rule Memory Belief Memory Agent World State B1, B2, B3, ……….. Next time event State at next  time event TF1  C1 and C5 => B2 TF2  C8 => B9 TF3  C9 and C6 and C8 => B10 Thoughtframe Rule Memory
Symbolic Discrete  Event System Production Rules represent  Qualitative Relationships !! Situation-action Rules
Multiagent Modeling Language BRAHMS Virtual Machine Scheduler T:0 belief X T:1 fact Y … . … . T:N belief Z World State fact F1 . fact Fn fact Y Java class Activity2 extends    AbstractExternalActivity {  ….  } class Agent5 extends    AbstractExternalAgent  { …. } Java Agent 5 World environment
Brahms: Distributed MAS Agent Directory Service
Brahms Agent Engine
Brahms Virtual Machine Agent Engine Discrete Event Queue Belief RSN Fact RSN Belief Set Work Selector Work Executor World State Fact Set Real-Time Mode Scheduler Discrete Event Queue Event Distributor SIM Mode
Brahms Model compilation-unit ::=  [ PCK. package-declaration  ]* [ IMP. import-declaration  ]* [ GRP. group  |    AGT. agent  |    CLS. class  |   OBJ. object  |   COC. conceptual-class  |   COB. conceptual-object  |   ADF. areadef  |    ARE. area  |   PAT. path  ]* A Brahms model consists of an number of  compilation units Each  compilation unit  is usually put in a separate .b file
Brahms Packages and Compilation Unit A compilation unit is a file with the extension '.b'.  A compilation unit consists of 3 parts, each of which is optional: A package declaration, giving the fully qualified name of the package to which the compilation unit belongs. For example, “package projects.Atm;”  Import statements that allow types from other packages to be referred to using their simple names. For example, “import projects.Atm.*;” Type declarations of group, agent, class, object, conceptual object class, conceptual object, area definition, area and path types.
Model Files
Brahms Compiler (bc) [~/Applications/AgentEnvironment/bin] sierhuis% ./bc NASA Ames Research Center Brahms Compiler Version 2.21.8 Copyright (c) 1997-2008 NASA Ames Research Center. All Rights Reserved. Usage: bc [options] <brahms file> Options: -lp <library-path>  set library path -source <source-path>  set the source code path -d <destination-path>  set the path where to write the compiled code to. -bar <archive file>  the archive file in which to store the files with the compiled code. -dtd <dtd path>  set the path where DTD files can be found -uml  generate XMI-based UML for the model -cp  set the Java class path to find Java activities -?  displays usage text Brahms file: .b file to be compiled
Command Line Model Compilation sierhuis% pwd /Users/sierhuis/Documents/eclipse/workspace/Brahms Tutorial Files/AtmModel/final_source sierhuis%  ~/Applications/AgentEnvironment/bin/bc -lp ~/Applications/AgentEnvironment/Models/lib -source source -d build -bar ./lib/AtmModel.bar ./source/gov/nasa/arc/brahms/atm/AtmModel.b NASA Brahms Compiler Version 2.21.8 Copyright (c) 1997-2008 NASA Ames Research Center. All Rights Reserved. 0 error(s), 0 warning(s) Exporting model as XML 0 error(s), 0 warning(s) Creating Brahms archive file. Archive './lib/AtmModel.bar' created.

Brahms Agent-Based Modeling & Simulation Course #1

  • 1.
    Brahms Tutorial Overviewof Brahms and Anatomy of a Brahms model
  • 2.
    Brahms Multi-Agent LanguageLanguage Compiler Interactive Development Environment Discrete-event Simulation Engine / Virtual Machine End-user Simulation Displays Simulation History Data Base Java-based Java API XML Runs on PC’s, Mac, Unix, Linux ... © Maarten Sierhuis
  • 3.
    Why Brahms? Howpeople work together How people get to participate in a collaborative activity Role of the environment / use of space How communication happens The tools and artifacts used Individual motives, history and culture Not just problem-solving activities Simulation as a work system design/analysis tool Humans as social and collaborative agents Agents are situated, deliberative, cognitive and reactive Brahms is a general purpose modeling and simulation environment Understanding how people really work Developing multi-agent systems Theoretical Practical
  • 4.
    Methodology: Simulationto Implementation September 29, 2009 Implementation Future Ops Simulation Metrics & Data Current Ops Simulation Work System Design Workflow Tool Observation Operations
  • 5.
    September 29, 20092 4 6 8 10 TRL 1992 1996 2000 2004 2008 NYNEX JPL JSC APOLLO VICTORIA JSC MOD OCAMS PROJECT BRAHMS – HISTORY OF APPLICATIONS ISS Surface Hab Mobile * Agents * Supported ExPOC and Scout robot and crew in Sept’06 field test & Pogo Test in July ‘07 Aeronautics CTFM PROJECT Brahms 24x7 in Mission Control
  • 6.
    Types of AgentLanguages
  • 7.
    Overview of BrahmsAgent Environment Agent Environment consists of the following: Brahms Agent Oriented Language Composer for building models. (or Integrated Development Environment). Compiler for compiling models. Virtual Machine for simulating models. (or Simulation Engine). Agent Viewer for viewing simulations.
  • 8.
    Brahms Language AgentOriented / BDI Agents are first-class citizens Agents are belief based Agents are intention based: Beliefs become intentions that trigger reasoning- and/or situation-action rules Organizational Modeling Agents can be modeled within an hierarchical member-of inheritance structure Object-based Objects can represent physical artifacts, data and concepts to reason with Integration of Java objects as data objects, Java activities and Java agents Geography-based Areas can be conceptual representations of locations Areas can be located within other areas, creating a hierarchical environment model Agents and objects can be located within an area
  • 9.
    Agent Organization Groupmembership inheritance hierarchy Artifacts in the world as objects relevant in activities Tools and artifacts people use Class hierarchies Data as objects Information modeling Environment and its state Represented hierarchically as areas with sub-areas Agents and objects are located within areas World State (facts vs. beliefs of agents) Detecting facts (reactive) Behavior as situated activities that take time Constraint on beliefs (workframes) Primitive or composite (decomposed) Goal-directed reasoning behavior as production rules within an activity that takes time Forward-chaining rules that take no time (thoughtframes) What Brahms Models Include
  • 10.
    Anatomy of aBrahms Model Language Concepts Groups Agents Classes Objects AreaDefs Areas Paths Conceptual Classes Conceptual Objects Attributes (OA-V) Relations (ORO) Beliefs Facts Activities Workframes Preconditions Consequences Detectables Thoughtframes agent-based object-based geo-based object flows mental state/world state activity-based/ subsumption rule-based reactive inferences
  • 11.
    Brahms Agent Engine Beliefs (atomic formulas) Desires (workframes thoughtframes belief matching) Plans (workframes Thoughtframes activities) Intentions (workframes thoughtframes instantiations) input action output Beliefs-Desires-Intentions
  • 12.
    Brahms: agent-oriented languageSymbolic Discrete Event BDI-like System Production and Situation-action Rules WF1 C1 and C2 and C3 => Detect F4, Activity1(t), B5, B7 WF2 C4 => Activity2(t), B6 WF3 C5 and C6 and C7 => Detect F8, Activity1(t), F9 F1, F2, F4 ….. Workframe Rule Memory Belief Memory Agent World State B1, B2, B3, ……….. Next time event State at next time event TF1 C1 and C5 => B2 TF2 C8 => B9 TF3 C9 and C6 and C8 => B10 Thoughtframe Rule Memory
  • 13.
    Symbolic Discrete Event System Production Rules represent Qualitative Relationships !! Situation-action Rules
  • 14.
    Multiagent Modeling LanguageBRAHMS Virtual Machine Scheduler T:0 belief X T:1 fact Y … . … . T:N belief Z World State fact F1 . fact Fn fact Y Java class Activity2 extends AbstractExternalActivity { …. } class Agent5 extends AbstractExternalAgent { …. } Java Agent 5 World environment
  • 15.
    Brahms: Distributed MASAgent Directory Service
  • 16.
  • 17.
    Brahms Virtual MachineAgent Engine Discrete Event Queue Belief RSN Fact RSN Belief Set Work Selector Work Executor World State Fact Set Real-Time Mode Scheduler Discrete Event Queue Event Distributor SIM Mode
  • 18.
    Brahms Model compilation-unit::= [ PCK. package-declaration ]* [ IMP. import-declaration ]* [ GRP. group | AGT. agent | CLS. class | OBJ. object | COC. conceptual-class | COB. conceptual-object | ADF. areadef | ARE. area | PAT. path ]* A Brahms model consists of an number of compilation units Each compilation unit is usually put in a separate .b file
  • 19.
    Brahms Packages andCompilation Unit A compilation unit is a file with the extension '.b'. A compilation unit consists of 3 parts, each of which is optional: A package declaration, giving the fully qualified name of the package to which the compilation unit belongs. For example, “package projects.Atm;” Import statements that allow types from other packages to be referred to using their simple names. For example, “import projects.Atm.*;” Type declarations of group, agent, class, object, conceptual object class, conceptual object, area definition, area and path types.
  • 20.
  • 21.
    Brahms Compiler (bc)[~/Applications/AgentEnvironment/bin] sierhuis% ./bc NASA Ames Research Center Brahms Compiler Version 2.21.8 Copyright (c) 1997-2008 NASA Ames Research Center. All Rights Reserved. Usage: bc [options] <brahms file> Options: -lp <library-path> set library path -source <source-path> set the source code path -d <destination-path> set the path where to write the compiled code to. -bar <archive file> the archive file in which to store the files with the compiled code. -dtd <dtd path> set the path where DTD files can be found -uml generate XMI-based UML for the model -cp set the Java class path to find Java activities -? displays usage text Brahms file: .b file to be compiled
  • 22.
    Command Line ModelCompilation sierhuis% pwd /Users/sierhuis/Documents/eclipse/workspace/Brahms Tutorial Files/AtmModel/final_source sierhuis% ~/Applications/AgentEnvironment/bin/bc -lp ~/Applications/AgentEnvironment/Models/lib -source source -d build -bar ./lib/AtmModel.bar ./source/gov/nasa/arc/brahms/atm/AtmModel.b NASA Brahms Compiler Version 2.21.8 Copyright (c) 1997-2008 NASA Ames Research Center. All Rights Reserved. 0 error(s), 0 warning(s) Exporting model as XML 0 error(s), 0 warning(s) Creating Brahms archive file. Archive './lib/AtmModel.bar' created.