Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine...

16
Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Candidato Simone Romano

Transcript of Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine...

Page 1: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

Documentazione assistita di ABMs(Agent-Based Models)

RelatoreProf. Vittorio ScaranoDott. Carmine Spagnuolo

CandidatoSimone Romano

Page 2: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

Automatic ABMs documentation - Simone Romano

Struttura della presentazione

• Panoramica modelli di simulazione basati sugli agenti - MASON • ODD Protocol e MASON• Doxygen

• Può aiutarci?

• Soluzione proposta: Plugin per Eclipse• Caratteristiche

• Conclusioni

Page 3: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

Automatic ABMs documentation - Simone Romano

Sistemi multi-agente

Branca relativamente nuova dell’informatica:• Primi studi: anni ‘80• Diffusione: circa metà anni ‘90

STRUTTURA• Agenti (entità autonoma)• Ambiente

Page 4: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

Automatic ABMs documentation - Simone Romano

MASON“MASON is a fast discrete-event multiagent simulation library core in Java”

STRUTTURA• Agenti - Steppable• Ambiente – SimState

OBIETTIVO: Generazione assistita di documentazione di programmi MASON

Page 5: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

Idea• Procedura guidata mirata alla generazione

documentazione

Page 6: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

ODD Protocol1. Purpose2. Entities, State variables and scales3. Process overview and scheduling4. Design concepts5. Initialization6. Input7. Submodels

MASON1. Definito dall’utente2. Ambiente, Agenti, variabili3. Lista azioni eseguite in

• start() SimState• step() Steppable

4. Definito dall’utente5. Valore iniziale delle variabili6. Definito dall’utente7. Pseudo-codice delle azioni elencate in 3

Come si documenta un ABMs?

Page 7: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

• Doxygen is the de facto standard tool for generating documentation from annotated C++ sources, but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java, Python, IDL (Corba, Microsoft, and UNO/OpenOffice flavors), Fortran, VHDL, Tcl, and to some extent D.

Automatic ABMs documentation - Simone Romano

Page 8: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

Automatic ABMs documentation - Simone Romano

Ricreiamo ODD• Parsing del codice• Generazione automatica di informazioni

• Informazioni inserite dall’utente• Generazione commenti al codice

Page 9: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

Plug-in – caratteristiche 1• Generazione pseudocodice• Fasi Process overview and scheduling, Submodels di ODD

• Selezione colore output• Separazione tra commenti autogenerati e commenti inseriti

dall’utente

Definito dall’utente

Generato dal plugin

Generato da Doxygen

Page 10: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

• Pulizia del codice

Plug-in – caratteristiche 2

Page 11: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

• Iterabilità• ODD object

• Output type• Doxygen• Pdf-Rtf (iText library)• Txt

Plug-in – caratteristiche 3

Page 12: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

Flusso degli eventi

INTRO OUTPUTChoice

ODD serialized

object

• Purpose• Entities, state

variables and scales• Process overview

and scheduling• Design concepts• Initialization• Input

• Submodels

New ODD object

Doxygen

• Pdf• Rtf• txt

Page 13: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

Screenshots - 1

Page 14: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

Screenshots - 2

Page 15: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

Screenshots - 3

Page 16: Documentazione assistita di ABMs (Agent-Based Models) Relatore Prof. Vittorio Scarano Dott. Carmine Spagnuolo Candidato Simone Romano.

Conclusioni

• OBIETTIVO INIZIALE• Documentare programmi di simulazione multi-agente scritti in Java con

libreria MASON

• PRODOTTO REALIZZATO• Supporta l’utente durante la fase di documentazione• Struttura la documentazione secondo uno standard noto (ODD)