multiagent systems a practical approach to mas construction in java (using boris) simon lynch...

17
multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch [email protected]

Post on 20-Dec-2015

224 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

multiagent systems

a practical approach toMAS construction in Java

(using Boris)

Simon Lynch [email protected]

Page 2: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

software architecture

SpeechRecognition

LanguageEngine Pragmatic

Integration

DialogManager

ExpertSystem

SpeechSynthesis

W orkingKn Base

LTMKn Base

LanguageGeneration

GUIModels

Visualiser

W igitInput

synchronisation

synchronisation

•distributed•mixed language•concurrent

Page 3: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

Boris agents – why?

MultiAgent Systems...

• advanced s/w architecturesdynamic, distributeddecentralised controlsocial, goal-based

• mobility, platform independence• design-time autonomy• reuse

Page 4: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

Boris agents – what?

• independent software(?) entities– send & receive messages

like objects but...– distributed– autonomous at design & execution– have their own process thread– tighter encapsulation & interfaces– task oriented

Page 5: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

Boris agents – types?

various types...• web based, brokered• small & mobile• larger scale / intelligent...etc...

Page 6: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

Boris agents - how?

in Java with Boris(because you can also use C#, Lisp...)

analogy...• agents & GUI components• GUI events & message events

Page 7: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

Boris example

Portal p = new Portal( portal-name );Agent a = new Agent( agent-name );a.addMessageListener(new MessageListener(){ public void messageReceived(String from, String to, String msg, MsgId

id) { ...code body... }});p.addAgent( a );

Panel p = new Panel();Button b = new Button( text );b.addActionListener( new ActionListener(){ public void actionPerformed( ActionEvent event ) { ...code body... }});p.add( b );

Page 8: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

Sending messagesPortal p = new Portal( portal-name );Agent sue = new Agent( "sue" );sue.addMessageListener(new MessageListener(){ public void messageReceived(String from, String to, String msg, MsgId id) { ...code body... }});p.addAgent( sue );Agent sam = new Agent( "sam" );p.addAgent( sam );

...sam.sendMessage( "sue", "hello sue" );...

Page 9: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

Virtual Networks

normally, agents are distributed across• multiple VMs• multi-language VMs• multiple machines

Boris uses network concept based on...• Portals• Routers

Page 10: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

agents, portals, routers & VMs

agent

agent

agent

agent

agent

MAS design...

a collection of communicating agents

Page 11: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

agents, portals & routers

• agents communicate via portals

• portals communicate via router(s)

agent

agentpor t al

agent

agentpor t al

shar ed VM

agent

agent

agent

por t alr out er

Page 12: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

agents, portals & routers

• agents who share a portal communicate directly

• routers not necessary for single-portal MASs

agent

agentpor t al

agent

agentpor t al

shar ed VM

agent

agent

agent

por t alr out er

Page 13: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

agents, portals & routers

• cross-portal communication requires a router even if portals share a VM

agent

agentpor t al

agent

agentpor t al

shar ed VM

agent

agent

agent

por t alr out er

Page 14: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

connecting portals to routers

portal methods• void connectToGrid( InetAddress host, int portNo

)• void connectToGrid( int portNo )• void connectToGrid( InetAddress host )• void connectToGrid( )

NB:• connection in separate thread• may take few seconds over internet

Page 15: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

using the console

Page 16: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

loading agentsimport boris.kernel.*;.....public class MyClass{ public MyClass( Portal portal, String cmdLine )

{ //--- set up agent ----final Agent agent = new Agent( name );portal.addAgent( agent );.....

}.....}

Page 17: Multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch s.c.lynch@tees.ac.uk

tracking activity