GORITE Execution1 team model Performer, Team, Team.TaskTeam, Team.Role process model Capability, Plan, Goal SequenceGoal, ParallelGoal, BDIGoal, TeamGoal,...

Slides:



Advertisements
Similar presentations
Generalized Requests. The current definition They are defined in MPI 2 under the hood of the chapter 8 (External Interfaces) Page 166 line 16 The objective.
Advertisements

COS 461 Fall 1997 Network Objects u first good implementation: DEC SRC Network Objects for Modula-3 u recent implementation: Java RMI (Remote Method Invocation)
Written by: Dr. JJ Shepherd
CERTIFICATION OBJECTIVES Use Class Members Develop Wrapper Code & Autoboxing Code Determine the Effects of Passing Variables into Methods Recognize when.
Exception Handling Chapter 15 2 What You Will Learn Use try, throw, catch to watch for indicate exceptions handle How to process exceptions and failures.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 15: Exception Handling.
Chapter 16: Exception Handling C++ Programming: From Problem Analysis to Program Design, Fifth Edition.
Objectives In this chapter you will: Learn what an exception is Learn how to handle exceptions within a program See how a try / catch block is used to.
SE-1020 Dr. Mark L. Hornick 1 Exceptions and Exception Handling.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 16: Exception Handling.
Chapter 10 Introduction to Arrays
1 More on Threads b b A section of code executed independently of other threads written within a single program. b b Java threads can access global data;
Java Programming, 3e Concepts and Techniques Chapter 4 Decision Making and Repetition with Reusable Objects.
EXCEPTIONS Def: An exception is a run-time error. Examples include: attempting to divide by zero, or manipulate invalid data.
1 Java - Threads A thread is an individual flow of control within a larger program. A program which is running more than one thread is said to be multithreaded.
IBM WebSphere survey Kristian Bisgaard Lassen. University of AarhusIBM WebSphere survey2 Tools  WebSphere Application Server Portal Studio Business Integration.
Exceptions in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Java ThreadsGraphics Programming Graphics Programming: Java Threads.
VB in Context Michael B. Spring Department of Information Science and Telecommunications University of Pittsburgh Pittsburgh, Pa 15260
1 Fall 2008ACS-1903 for Loop Reading files String conversions Random class.
Fundamentals of Python: From First Programs Through Data Structures
Department of Computer Science 1 CSS 496 Business Process Re-engineering for BS(CS)
Programming Paradigms Imperative programming Functional programming Logic programming Event-driven programming Object-oriented programming A programming.
Software Testing Sudipto Ghosh CS 406 Fall 99 November 9, 1999.
Reusable Code For Your Appx Processes Presented By: Gary Rogers.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
1 Web-Enabled Decision Support Systems Objects and Procedures Don McLaughlin IE 423 Design of Decision Support Systems (304)
ASP.NET Programming with C# and SQL Server First Edition Chapter 3 Using Functions, Methods, and Control Structures.
CSE 425: Object-Oriented Programming I Object-Oriented Programming A design method as well as a programming paradigm –For example, CRC cards, noun-verb.
Java Threads 11 Threading and Concurrent Programming in Java Introduction and Definitions D.W. Denbo Introduction and Definitions D.W. Denbo.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Arrays An array is a data structure that consists of an ordered collection of similar items (where “similar items” means items of the same type.) An array.
1 Web Based Programming Section 8 James King 12 August 2003.
Partitioning Patterns How to partition complex actors and concepts into multiple classes. Layered Initialization Filter Composite.
Chapter 14: Exception Handling. Objectives In this chapter, you will: – Learn what an exception is – Learn how to handle exceptions within a program –
Visual Basic Programming
Data Structures Using Java1 Chapter 2 Inheritance and Exception Handling.
Concurrent Programming and Threads Threads Blocking a User Interface.
Loops (cont.). Loop Statements  while statement  do statement  for statement while ( condition ) statement; do { statement list; } while ( condition.
Multithreading in Java Sameer Singh Chauhan Lecturer, I. T. Dept., SVIT, Vasad.
ICS 313: Programming Language Theory Chapter 13: Concurrency.
A university for the world real R © 2009, Chapter 9 The Runtime Environment Michael Adams.
IBM TSpaces Lab 3 Transactions Event Registration.
Introduction to Threads Session 01 Java Simplified / Session 14 / 2 of 28 Objectives Define a thread Define multithreading List benefits of multithreading.
15.1 Threads and Multi- threading Understanding threads and multi-threading In general, modern computers perform one task at a time It is often.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
Multithreaded programming  Java provides built-in support for multithreaded programming. A multithreaded program contains two or more parts that can run.
Multithreading. Multithreaded Programming A multithreaded program contains two or more parts that can run concurrently. Each part of such a program is.
Chapter 15: Exception Handling C++ Programming: Program Design Including Data Structures, Fifth Edition.
Exception-Handling Fundamentals  A Java exception is an object that describes an exceptional (that is, error) condition that has occurred in a piece of.
PROGRAMMING TESTING B MODULE 2: SOFTWARE SYSTEMS 22 NOVEMBER 2013.
Written by: Dr. JJ Shepherd
Advanced Java class Nested Classes & Interfaces. Types of Nested Classes & Interfaces top-level nested –classes –interfaces inner classes –member –local.
Cs205: engineering software university of virginia fall 2006 Programming Exceptionally David Evans
Today Threading, Cont. Multi-core processing. Java Never Ends! Winter 2016CMPE212 - Prof. McLeod1.
CSE 332: C++ Exceptions Motivation for C++ Exceptions Void Number:: operator/= (const double denom) { if (denom == 0.0) { // what to do here? } m_value.
Business Process Execution Language (BPEL) Pınar Tekin.
Java Thread Programming
Threads in Java Two ways to start a thread
Java Programming Language
Important terms Black-box testing White-box testing Regression testing
Important terms Black-box testing White-box testing Regression testing
Control Structures (Structured Programming) for controlling the procedural aspects of programming CS1110 – Kaminski.
Representation, Syntax, Paradigms, Types
Multithreading.
Multithreaded Programming
Languages and Compilers (SProg og Oversættere)
Control Structures (Structured Programming) for controlling the procedural aspects of programming CS1110 – Kaminski.
Lecture 19 Threads CSE /6/2019.
Threads and concurrency / Safety
Presentation transcript:

GORITE Execution1 team model Performer, Team, Team.TaskTeam, Team.Role process model Capability, Plan, Goal SequenceGoal, ParallelGoal, BDIGoal, TeamGoal,... data model Data, Data.Element Relation, Query And, Or, Distinct,...

GORITE Execution2 Three Model Perspectives Code Team Model Process Model Data Model

GORITE Execution3 Example Capability public class FriendGreeting extends Capability { public Relation friends = new Relation( “friends”, String.class ); public FriendGreeting() { addGoal( new Plan( “say hello”, new Goal [] { new BDIGoal( “say friendly hello” ), new BDIGoal( “review things lent to friend” ) } ) { public Query context(Data d) { return friends.get( d.getValue( “who” ) ); } } ); } } public Relation friends = new Relation( “friends”, String.class ); addGoal( new Plan( “say hello”, new Goal [] { new BDIGoal( “say friendly hello” ), new BDIGoal( “review things lent to friend” ) } ) { public Query context(Data d) { return friends.get( d.getValue( “who” ) ); } } ); plan body plan context

GORITE Execution4 Example Performer public class Friendly extends Performer { public Friendly( String name ) { addCapability( new FriendlyGreeting() ); } public Perceptor hello = new Perceptor( this, “say hello” ) {{ data_name = “who”; }}; } public Perceptor hello = new Perceptor( this, “say hello” ) {{ data_name = “who”; }}; [Friendly] hello.perceive(... )‏

GORITE Execution5 Example Main new Thread( Executor.getDefaultExecutor() ).start(); // Start GORITE Performer kevin = new Friendly( “kevin” ); kevin.hello.perceive( “marge” );

GORITE Execution6 [Executor] “[gorite]” Executor Perspective [Performer] “kevin” [TodoGroup] “percepts” [FriendlyGreeting] [Plan] “say hello” friends (String)‏ perceive(“marge”)‏ run()‏ [Data] who=”marge” BDIGoal(“say hello”).Instance

GORITE Execution7 Process Model Execution Goal performed by “instantiating” it represents intention Goal.Instance extension according to goal type keeps state and has progress method single thread progressing all intentions of all teams step may fail, pass, stop or block Data object named data elements

GORITE Execution8 BDIGoal Execution a BDIGoal of given name is performed by: look up the plans of that same name within the current capability; apply their context queries to determine variants; select one and perform it; if it fails: restore data context redo procedure, but exclude failed variants succeed as soon as a plan variant succeeds preserve the plan variant's data context

GORITE Execution9 Current Capability data element “agent” the current performer (which is a capability)‏ recursive lookup: all plans in current capability and any sub capability looking for plans of same name as BDIGoal

GORITE Execution10 Context Query a “logical query” possibly involving “logical variables” (Ref objects)‏ Ref $x = new Ref( “$x” )‏ each valid binding defines a plan variant when selected, the Data is updated with the selected binding data.getValue( “$x” )‏ restored on failure, preserved on success

GORITE Execution11 Recall Example Plan addGoal( new Plan( “say hello”, new Goal [] { new BDIGoal( “say friendly hello” ), new BDIGoal( “review things lent to friend” ) } ) { public Query context(Data d) { return friends.get( d.getValue( “who” ) ); } } ); Query without logical variables

GORITE Execution12 Context Method Return Query object treated as predicate P(x1,..,xn)‏ processed exhaustively to generate plan variants may provide zero variants null “true”; one variant of the plan Context.EMPTY‏ “false”; the plan is not applicable

GORITE Execution13 Composite Queries And( Query... conjuncts )‏ Or( Query... disjuncts )‏ Condition()‏ public boolean condition() {... } Distinct( Ref... variables )‏ Snapshot( Query query )‏ interface Query, class QueryBase

GORITE Execution14 Ref Objects named new Ref( String name )‏ name used when context established in Data void set( Object value )‏ null means un-set Object get()‏

GORITE Execution15 Plan Variants when / why would you want multiple plan variants simultaneously applicable? [BDIGoal] “X” [Plan] “X” p(“A”,”B”)‏ “A”=.. “B”=.. [Plan] “X” q(“Z”)‏ [Plan] “X” “A”=.. “B”=.. “A”=.. “B”=.. “Z”=..

GORITE Execution16 Data goal execution is done with respect to a Data container object container of named data elements multi-valued (“temporal”)‏ gold-fish mode transient, dynamic bindings name lookup relative intention i.e. name “foo” may differ on parallel paths

GORITE Execution17 Recall Example Plan Again addGoal( new Plan( “say hello”, new Goal [] { new BDIGoal( “say friendly hello” ), new BDIGoal( “review things lent to friend” ) } ) { public Query context(Data d) { return friends.get( d.getValue( “who” ) ); } } ); plan body = sub goals Plan extends SequenceGoal

GORITE Execution18 Example Goal Hierarchy [Plan] “say hello” { friends(“who”) } [BDIGoal] “say friendly hello” [BDIGoal] “review things lent to friend” 1 2 2

GORITE Execution19 SequenceGoal Execution performs each sub-goal in sequence if sub goal fails, then the SequenceGoal fails if sub goal blocks, then the SequenceGoal blocks re-enters same sub goal on re-entry if sub goal stops, then the SequenceGoal stops re-enters same sub goal on re-entry if sub goal passes, then the next sub goal is instantiated and performed if last sub goal, then the SequenceGoal passes if sub goal throws exception, the SequenceGoal throws

GORITE Execution20 ParallelGoal Execution performs all sub goals “in parallel” instantiates all as “branches”, and performs one if sub goal fails, all other branches are cancelled, and the ParallelGoal fails if sub goal blocks or stops, the ParallelGoal shifts focus to the next branch if all sub blocks or stops, the ParallelGoal blocks or stops if sub goal passes, the ParallelGoal shifts focus to next branch if all have passed, the ParallelGoal passes if sub goal throws exception, all branches are cancelled and the exception is re-thrown

GORITE Execution21 ConditionGoal Execution tries sub goals in sequence until one passes on sub goal fail: instantiate and try next on sub goal pass: pass on sub goal block: block on sub goal stop: stop on sub goal exception: cancel and re-throw

GORITE Execution22... and so forth SequenceGoal, ParallelGoal, ConditionGoal FailGoal, ControlGoal, RepeatGoal, LoopGoal, EndGoal BDIGoal, TeamGoal Plan, Goal

GORITE Execution23 TeamGoal Execution find fillers as data element named by role Performer.RoleFilling objects splits into a parallel branch for each filler BDI style goal processing using the Performer.RoleFilling capability instaniated to combine Role and Performer Role goals performed by team, focussed on filler otherwise execution is “transferred into performer” by manipulating the “agent” data element

GORITE Execution24 [Performer] [Team] [Data] “foo” = {v1,v2,..} “bar” = {a,b,c...} “fum” = {...} “agent” = {current} “...” = {...} Transient Shared Data

GORITE Execution25 [Capability] The Team Picture [Performer] [TodoGroup] fum [TodoGroup] bar Beliefs plans intention (name)‏ [Team] [TaskTeam] [Role] [TaskTeam] [Role]

GORITE Execution26 GORITE Model - Instantiated an Executor object that all performers are added to for executing TodoGroup intentions default single Executor, automatic, lazily if a Performer lacks an Executor when one is needed, then the default one is use (created first)‏

GORITE Execution27 Executor Executor Perspective [Performer] Team Performer [Performer] Team Performer [Performer] Team Performer [Performer] Team Performer

GORITE Execution28 Two Execution Entry Points Perceptor.perceive(Object)‏ asynchronous events model Executor.run()‏ Performer.performGoal(Goal,String,Data)‏ application main thread model e.g. closed loop simulation traverses intention tree down to TodoGroup intentions then, later, into those via Executor

GORITE Execution29 Perceptor = Percept Stream new Perceptor( Performer, String )‏ handler goal.. new BDIGoal( “handle percept” )‏ data name.. “percept” todo group name.. “percepts” performer perceptor.perceive( perception_data );

GORITE Execution30 [Executor] Thread Control Picture (In)‏ [Performer] percept run()‏ performGoal()‏EITHER! NOT BOTH! perceive( Object )‏

GORITE Execution31 The Executor runs through all (its) performers performing their todo groups each intention until it passes, fails, stops or blocks performGoal(..) uses Executor run() method implements Runnable usually single Executor each Executor claims its own “threading sandbox” No Shared Performers !!!

GORITE Execution32 Peformer.TodoGroup a Performer's named collection of some on- going “intentions” managed together Goal.Instance objects (sub classed)‏ meta goal invoked to manage todo group decide which one to progress next only one intention is progressed new decision on added, completed or blocked intention goals have “group” attribute progressed by TodoGroup execution

GORITE Execution33 Executor Connection Thread Control Picture (Out)‏ Action. execute Connector [Equipment] Action. execute RemoteCoaching RemoteGoal task goal Performer task goal initiate connection check status Java code 1 2 3

GORITE Execution34 Smallest Hello World new Performer( “ralph” ). performGoal( new Goal( “say hello” ) { public States execute(Data d) { System.out.println( “hello world” ); return PASSED; } }, null, new Data() ); Performer.performGoal( Goal, String, Data )‏

GORITE Execution35 Capability and Desire Performer ralph = new Performer( “ralph” ) {{ addGoal( new Goal( “say hello” ) { public States execute(Data d) { System.out.println( “hello world” ); return PASSED; } } ); }} ralph.performGoal( new BDIGoal( “say hello” ), “x”, new Data() ); declaring capability raising desire

GORITE Execution36 Task Goal a task goal instance invokes the execute method of the enclosing goal: public States execute(Data d) returns one of PASSED, FAILED, BLOCKED, STOPPED, CANCEL or throws exception LoopEndException, ParallelEndException

GORITE Execution37 Action to represent “equipment interface” one equipment - many actions action goal a goal that is achieved by performing the action reference to action within goal hierarchy many action goals for the same action (object)‏ input/output data elements named by goal Data.Element [] ins, Data.Element [] outs

GORITE Execution38 Action Example public class SteeringSystem { Action turn_left = new Action( “turn left” ) { public States execute( boolean reentry,Data.Element [] ins, Data.Element [] outs ) { } }; Action turn_right = new Action( “turn right” ) { public States execute( boolean reentry,Data.Element [] ins, Data.Element [] outs ) { } }; }

GORITE Execution39 Action Goals Example public class Steering extends Capability { public Steering(SteeringSystem ss) { addGoal( ss.turn_left.create( new String [] { “foo”, “bar” }, new String [] { “fum”, “car” } ) ); addGoal( ss.turn_right.create( new String [] { “foo”, “bar” }, new String [] { “fum”, “car” } ) ); }

GORITE Execution40 Remote Connection RemoteCoaching( connector )‏ capability (base class)‏ RemoteGoal task goal created within a RemoteCoaching capability invokes the connector.perform method input / output data (service request / response)‏ monitoring progress

GORITE Execution41 Connector Model Connector  manages “channel” to service provider Connection  instantiated for each service use (session)‏

GORITE Execution42 RemoteCoaching.Connection cancel()‏ called by RemoteGoal being cancelled States check()‏ called by RemoteGoal querying completion fail, pass, stop or block RemoteGoal updates Data on completion via the Ref objects given to Connector.perform

GORITE Execution43 RemoteCoaching Example public class Proxy extends Performer { public Proxy(String name) { super( name ); addCapability( new RemoteCoaching( new MultAndCoolyLink() ) {{ addGoal( new RemoteGoal( “service 1”,.... ) ); addGoal( new RemoteGoal( “service 2”,.... ) ); }} ); addCapability( new Capability() {{.... }} ); } }

GORITE Execution44 GORITE Execution Summary Perceptor, Executor.run()‏, performGoal(..)‏ goal instances, todo groups Goal.States, exceptions pass, fail, stop, block Plan, Context, Query, Relation, Ref objects Data, named data elements equipment modelling, RemoteCoaching

GORITE Execution45 Not Covered actions sequenced by data element readiness plan precedence relation keys trace naming of intentions (x.3:4.5*6:2)‏ dealing with data at intention fork and join blocking and triggering