Giter VIP home page Giter VIP logo

java_mobile_agents's Introduction

Java_mobile_agents

Implementation of simple container of mobile agents based on Java RMI.

Implement a simple container of mobile agents based on Java RMI. The container should be able to host a mobile agent and to run it. A specific primitive supported by the container should enable the migration from a container instance to another one. Implement weak mobility (the agent starts the execution from the first statement whenever it arrives onto a new node/container). With this approach, mobility transparency is not ensured.

Write and test a simple application that creates an agent and moves it across at least two other container nodes. On each node, the agent asks for the name of the user and, when it reaches the last node to visit, it shows the complete list of contacted users.

Spiegazione in italiano

In questo esercizio è stato implementato un semplice container di agenti mobili tramite Java RMI. Il container è in grado di ospitare l'agente mobile ed eseguirlo. Il container prevede una specifica primita che permette il trasferimento dell'agente da un container all'altro.

Java RMI è un middleware che consente di implementare applicazioni con architettura client server. Tuttavia, in questo caso è stato sfruttato per implementare il paradigma ad agenti mobili. Il paradigma ad agenti mobili è un paradigma diverso rispetto a quello client server.

Gli elementi fondamentali dell'applicazione sono:

  • Container.
  • Agenti.
  • Il processo server che ospita i container.
  • Il main.

Container

Il container concettualmente è un ambiente che ospita gli agenti mobili e ne gestisce l'esecuzione. In termini programmatici lo stesso si configura, in questo caso, come un oggetto remoto. Quindi, un container viene creato istanziando un oggetto remoto. A tal fine è stata prevista l'interfaccia AgentContainer e la classe AgentContainerImpl.

Agenti mobili

Gli agenti mobili rappresentano le entità che si spostano nei diversi container. A differenza della mobilità del codice con un agente si sposta anche lo stato, non solo il codice. In questo caso un agente mobile si concretizza in un ogetto di tipo MyAgent. La classe MyAgent estende la classe AbstarctAgent, che a sua volta implementa l'interfaccia Agent. Un oggetto di tipo MyAgent è serializzabile. Tramite la serializzazione un oggetto "MyAgent" viene linearizzato e trasferito nel container di destinazione.

Processo Server

All'avvio del processo server vengono creati dei container. Degli oggetti di tipo Container. Gli stessi sono registrati sul rmiregistry tramite un'operazione di rebind.

Main

Prima di avviare l'applicazione è necessario: avviare il binder rmiregistry, costruire i container tramite il server. Lanciando il main viene definito il percorso che l'agente dovrà seguire (i container che dovrà attraversare). Di default è previsto che l'agente attraversi tre container (container0, container1 e container2). Quindi viene ecreato e avviato un agente a cui si affida il tour.

java_mobile_agents's People

Contributors

iulianoroberto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.