Presentation is loading. Please wait.

Presentation is loading. Please wait.

G54DIA TUTORIAL – Multi Agent Solutions Julian Zappala.

Similar presentations

Presentation on theme: "G54DIA TUTORIAL – Multi Agent Solutions Julian Zappala."— Presentation transcript:

1 G54DIA TUTORIAL – Multi Agent Solutions Julian Zappala

2 Tutorial Overview This tutorial considers multi agent solutions:  Design/Conceptual Challenges Teamwork Concurrency/Fallibility of actions  Technical Considerations Serial (iterative) implementation Parallel (multi-threaded) implementation  Example Upgrading the DemoSimulator Upgrading the TankerViewer

3 Thinking about Teamwork #1 Size: How many agents? When does cooperation become competition? May require experimentation/calculation Composition: What kind of agents? Homogeneous: All agents are the same Heterogeneous: Agents have different abilities What types of roles might agents take? Communication #1: How is information exchanged? Shared memory? Messaging: Pheromones? Point to point? Broadcast? Face to face?

4 Thinking about Teamwork #2 Communication #2: What information is shared? About the environment? About tasks? About this agent? Team structure: Who's in charge? Anarchy: No control structure Despotic: A “manager” agent Democratic: Agents share choices Cooperation: How are tasks completed? One agent per task? More than one agent per task? Implications for exploration and exploitation? Other Ideas?

5 Concurrency/Fallibility of Actions Can more than one agent  be in the same cell concurrently?  be at the same well/station/fuel pump? If "No" then  How are these constraints enforced fairly?  What happens if an action fails? Resource contention and starvation: Which agent gets to refuel? Does agent X ever get to refuel? If "Yes" then what are the consequences?  e.g. “double deliveries” Other Ideas?

6 Technical Considerations Serial Implementation  Iterate over a collection of agents  agents perform actions in series  perhaps more straight forward  arguably less "realistic" Parallel Implementation  agents perform actions in parallel  deadlock - mutually waiting processes  race conditions - i.e operations on shared resources  synchronisation – atomic processing  library code may not be thread-safe Choice - there's nothing which can be done in one way which can't be done the other way!

7 A Simple Example Extends the demo package with multiple tankers This example illustrates  the iterative (serial) approach  one way to upgrade the user interface Is indicative of  the classes you may need to adapt  one of many ways in which this could be achieved Gives some hints and code fragments  but is not a full solution  assumes a “Fleet” class: a collection of tankers

8 Upgrading DemoSimulator Calling senseAndAct for each Tanker in the Fleet

9 Graphical User Interface Upgrading the GUI is optional but it may be useful for debugging etc... Possible upgrades include:  Selecting which agent to view  Showing other agents in the view  Other ideas? You'll need some familiarity with Java Swing libraries, e.g:   summary.html summary.html

10 Understanding TankerViewer #1 TankerViewer itself extends JFrame The main view is a JLayeredPane lp Child of Container c (ContentPane from JFrame) One layer for the environment (Layer 0) One layer for the tanker (Layer 1) The environment is drawn using: JPanel p (child of lp) JLabel[][] cells (children of p)

11 Understanding TankerViewer #2 The tanker is drawn using: JLabel tankerlabel (child of lp) Never redrawn The information panel JPanel infop (child of c) Has many JLabel children: water/fuel/location/score etc:

12 TankerViewer: Selecting a tanker (JComoBox) TankerViewer will need to implement the ActionListener Interface

13 TankerViewer: Show Other Tankers #1 Here we create a transparent grid of hidden tanker icons

14 TankerViewer: Show Other Tankers #2 Here we update the tick method so that it will show/hide tanker icons as appropriate

Download ppt "G54DIA TUTORIAL – Multi Agent Solutions Julian Zappala."

Similar presentations

Ads by Google