1 / 11

boris - additional

boris - additional. timers, scope & brokering. Simon Lynch s.c.lynch@tees.ac.uk. timers. why, what & how? agent timers countdown timers alarm timers. agent timers. Agent a = new Agent( name ); a.addAgentTimerListener( new AgentTimerListener() { public void timerElapsed( Agent a )

Download Presentation

boris - additional

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. boris - additional timers, scope & brokering Simon Lynch s.c.lynch@tees.ac.uk

  2. timers why, what & how? • agent timers • countdown timers • alarm timers

  3. agent timers Agent a = new Agent( name ); a.addAgentTimerListener( new AgentTimerListener() { public void timerElapsed( Agent a ) { ...code body... } }); a.setDelay( delay ); ... a.start(); ... a.stop(); ...

  4. the ball example Agent a = new Agent( "anon" ); a.addAgentTimerListener( new AgentTimerListener() { public void timerElapsed( Agent a ) { erase(); x = (x+dx) % bounds; y = (y+dy) % bounds; display(); } }); a.setDelay( delay ); display(); a.start(); }

  5. a countdown timer Agent a = new Agent( name ); a.addAgentTimerListener( new AgentTimerListener() { public void timerElapsed( Agent a ) { if( coundown-elapsed ) { a.stop(); switchOff(); } else { ...code body... } } }); a.setDelay( delay ); switchOn(); a.start();

  6. alarm timer given: Calendar alarmTime... Agent a = new Agent( name ); a.addAgentTimerListener( new AgentTimerListener() { public void timerElapsed( Agent a ) { a.stop(); alarmOn(); } }); long alarmMS = alarmTime.getTime().getTime(); long nowMS = new Date().getTime(); a.setDelay( alarmMS – nowMS ); if (delay > 0 ) a.start(); else alarmOn();

  7. scope why, what & how? • MAS partitions • holons • reduced complexity • tailored partitions (eg: localised brokers) • enhanced security

  8. scope in Boris why, what & how? • internal - behind portal • local - behind router • global - the default

  9. scope

  10. scope in Boris why, what & how? portal.addAgent( agent ) portal.addAgent( agent, Portal.INTERNAL ) portal.addAgent( agent, Portal.LOCAL )

  11. Brokers yellow pages agents • some are localised (in holons, etc) • some keep record of providers • need for central service? in boris / java • map agents to services • services to agents • etc

More Related