multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch [email protected] software architecture synchronisation Language Engine Pragmatic Integration Speech Recognition Working Kn Base synchronisation Speech Synthesis Language Generation LTM Kn Base Dialog Manager Expert System Wigit Input GUI Models Visualiser •distributed •mixed language •concurrent Boris agents – why? MultiAgent Systems... • advanced s/w architectures dynamic, distributed decentralised control social, goal-based • mobility, platform independence • design-time autonomy • reuse 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 Boris agents – types? various types... • web based, brokered • small & mobile • larger scale / intelligent ...etc... Boris agents - how? in Java with Boris (because you can also use C#, Lisp...) analogy... • agents & GUI components • GUI events & message events Boris example Panel p = new Panel(); Button b = new Button( text ); b.addActionListener( new ActionListener() { public void actionPerformed( ActionEvent event ) { ...code body... } }); p.add( b ); 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 ); Sending messages Portal 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" ); ... Virtual Networks normally, agents are distributed across • multiple VMs • multi-language VMs • multiple machines Boris uses network concept based on... • Portals • Routers agents, portals, routers & VMs agent agent agent agent agent MAS design... a collection of communicating agents agents, portals & routers agent agent portal agent agent agent portal agent router portal agent shared VM • agents communicate via portals • portals communicate via router(s) agents, portals & routers agent agent portal agent agent agent portal agent router portal agent shared VM • agents who share a portal communicate directly • routers not necessary for single-portal MASs agents, portals & routers agent agent portal agent agent agent portal agent router portal agent shared VM • cross-portal communication requires a router even if portals share a VM connecting portals to routers portal methods • void connectToGrid( • void connectToGrid( • void connectToGrid( • void connectToGrid( InetAddress host, int portNo ) int portNo ) InetAddress host ) ) NB: • connection in separate thread • may take few seconds over internet using the console loading agents import boris.kernel.*; ..... public class MyClass { public MyClass( Portal portal, String cmdLine ) { //--- set up agent ---final Agent agent = new Agent( name ); portal.addAgent( agent ); ..... } ..... } tracking activity
© Copyright 2024 Paperzz