multiagent systems a practical approach to MAS construction in Java (using Boris) Simon Lynch
software architecture 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 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 );
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 MAS design... a collection of communicating agents
agents, portals & routers agents communicate via portals portals communicate via router(s)
agents, portals & routers agents who share a portal communicate directly routers not necessary for single-portal MASs
agents, portals & routers cross-portal communication requires a router even if portals share a VM
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
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