2
Aspectos @ PUC-Rio PUC-Rio PUC-Rio nomes http://www.teccomm.les.inf.puc-rio.br/SoCAgents Brasil Brasil M etrics D efinition Concern D iffusion over Com ponents(CD C) Counts the number of classes and aspects whose main purpose is to contribute to the im plem entation of a concern and the num ber of other classesand aspectsthataccessthem . Concern D iffusion over O perations(CD O ) Counts the number of m ethods and advices whose m ain purpose is to contribute to the im plem entation of a concern and the num ber of other m ethodsand advicesthataccessthem . SoC Concern D iffusion over LO C (CD LO C) Counts the num beroftransition points through lines ofcode.A transition pointisa place in the code w here there isa “concern sw itch”. Coupling Betw een Com ponents(CBC) Counts the num ber of other classes and aspects to which a class or an aspectiscoupled. Coupling D epth ofInheritance Tree (D IT) Counts how far down in the inheritance hierarchy a class or aspect is declared. C ohesion Lack ofCohesion in O perations(LCO O ) M easures the lack of cohesion of a class or an aspect in term s of the am ountof m ethod and advice pairs thatdo notaccess the sam e instance variable. LinesofCode (LO C) Countsthe linesofcode. N um berofA ttributes(N O A) Countsthe num berofattributesofeach classoraspect. Size W eighted O perationsper Com ponent(W O C) Counts the num berofm ethodsand advices ofeach classoraspectand the num berofitsparam eters. getX getY getColor setColor Point getP1 getP2 getColor setColor Line F igureE lement Figure 1 * Display Screen update <<interface>> O bserver addO bserver rem oveO bserver notify <<interface>> Subject getX getY getColor setColor Point getX getY getColor addO bserver rem oveO bserver notify setX setY setColor Point getP1 getP2 getColor setColor Line getP1 getP2 getColor addO bserver rem oveO bserver notify setP1 setP2 setColor Line F igureE lement Figure 1 * Display Screen update Display Screen update <<interface>> O bserver update <<interface>> O bserver addO bserver rem oveO bserver notify <<interface>> Subject addO bserver rem oveO bserver notify <<interface>> Subject Métricas - Avaliação - Estudos Empíricos - Padrões OO vs. Aspectos - Abordagem Gerativa - Ver Poster 12 - Sistemas Multi-Agentes - O Domínio - Método para SMAs Agent Observable addLC() removeLC() notifyLC () LM S processInformation() getLR () Learning C omponent Role collaboratingAgents collaborationProtocol getName() addAgent() rem oveAgent() Chair papers learningComponents submissionDeadline review Deadline addLC () rem oveLC() notifyLC () distributeProposal() ... R eview er J ADEAgent getName() moveAgent() beforeMove() U serAgent researchInterests publications reviews learningComponents addPC participation() addLC () rem oveLC() notifyLC () P lan goal agent clone() execute () C VU pdatePlan learningComponents addLC () rem oveLC() notifyLC () execute () JudgementPlan Judgem ent ReceptionPlan learningR ate processInformation() TD -Learning processInformation() getTD () getR eward() setR eward() Strategy pattern learningComponents addLC () rem oveLC() notifyLC () execute () evaluateResponse() ... learning-specific m embers m ethods w ith som e learning code learning-specific classes C ollaboration Learning Basic C oncerns public Result judgeProposal(...) { ... lc.processInformation(); ... } Interaction Observer pattern Environm ent ... ... Agenda PersistentC V addR esearchKW () addPublication() addAw ard() addC onference() D SInterface getU serAnswer() getAnswerTim e() public void addPublication(...){ ... sensor.senseEvent(); ... } E ffector Sensor receive() senseE vent() ... send() ... interaction-specific m em bers m ethods w ith som e interaction code interaction-specific classes R evisionProposal paper deadlines currentPaperInterest proposalEvaluation isAccepted() getPaperInterest() getEvaluation() goals plans sensors effectors addAgent() sendM sg() receiveMsg() Legend: chairNam e papersToR eview learningComponents setC hair() addLC () rem oveLC() notifyLC () returnJudgement() learningComponents addLC () rem oveLC() notifyLC () execute () judgeProposal() emitJudgement() ... Padrões GoF Know ledge Updating Behavior Adaptation K ernel Services Know ledge Adaptation Traveling M essage Reception Interaction A daptation G oal C reation Execution Autonom y Autonom y Role Binding C ollaboration Protocol C ollaboration M obility Legend: aspectual com ponent com ponent crosscutting interface norm al interface M essage Sending A genthood A dditional P roperties Extrinsic Know ledge A nsw erer #4 ailability Plan A gent U ser A gent Inform ation A gent Interface A gent Middle A gent #2 Evolution and R euse Scenario #2 Plan Searching Plan K now ledge Proposal Autonom y Autonom y Interaction Interaction Collaboration Collaboration Adaptation Adaptation Editor Editor Content Content Supplier Supplier Caller #4 Counter Proposal S ystem View point 0 10 20 30 40 50 60 70 80 90 100 Percentage P atterns Aspects A nsw erer #4 ailability Plan A gent U ser A gent Inform ation A gent Interface A gent Middle A gent #2 Evolution and R euse Scenario #2 Plan Searching Plan Know ledge Proposal Autonom y Autonom y Interaction Interaction Collaboration Collaboration Adaptation Adaptation Editor Editor Content Content Supplier Supplier Caller #4 Counter Proposal

nomes teccomm.lesf.puc-rio.br/SoCAgents

  • Upload
    sarila

  • View
    23

  • Download
    0

Embed Size (px)

DESCRIPTION

nomes http://www.teccomm.les.inf.puc-rio.br/SoCAgents. Brasil. Estudos Empíricos - Padrões OO vs. Aspectos -. Sistemas Multi-Agentes - O Domínio -. Padrões GoF. Interação Adaptação Autonomia Colaboração Mobilidade Aprendizagem. Comparação. Comparação. Resultados. Resultados. - PowerPoint PPT Presentation

Citation preview

Page 1: nomes teccomm.lesf.puc-rio.br/SoCAgents

Aspectos @ PUC-RioPUC-RioPUC-Rio

nomeshttp://www.teccomm.les.inf.puc-rio.br/SoCAgents

BrasilBrasil

Metrics Definition

Concern Diffusion over Components (CDC)

Counts the number of classes and aspects whose main purpose is to contribute to the implementation of a concern and the number of other classes and aspects that access them.

Concern Diffusion over Operations (CDO)

Counts the number of methods and advices whose main purpose is to contribute to the implementation of a concern and the number of other methods and advices that access them.

SoC

Concern Diffusion over LOC (CDLOC)

Counts the number of transition points through lines of code. A transition point is a place in the code where there is a “concern switch”.

Coupling Between Components (CBC)

Counts the number of other classes and aspects to which a class or an aspect is coupled.

Cou

pli

ng

Depth of Inheritance Tree (DIT)

Counts how far down in the inheritance hierarchy a class or aspect is declared.

Coh

esio

n

Lack of Cohesion in Operations (LCOO)

Measures the lack of cohesion of a class or an aspect in terms of the amount of method and advice pairs that do not access the same instance variable.

Lines of Code (LOC) Counts the lines of code. Number of Attributes (NOA) Counts the number of attributes of each class or aspect.

Siz

e

Weighted Operations per Component (WOC)

Counts the number of methods and advices of each class or aspect and the number of its parameters.

getXgetYgetColoraddObserverremoveObservernotifysetXsetYsetColor

PointgetP1getP2getColoraddObserverremoveObservernotifysetP1setP2setColor

Line

FigureElementFigure 1 *

updateDisplay

Screen

update

<<interface>>Observer

addObserverremoveObservernotify

<<interface>>Subject

getXgetYgetColoraddObserverremoveObservernotifysetXsetYsetColor

PointgetXgetYgetColoraddObserverremoveObservernotifysetXsetYsetColor

PointgetP1getP2getColoraddObserverremoveObservernotifysetP1setP2setColor

LinegetP1getP2getColoraddObserverremoveObservernotifysetP1setP2setColor

Line

FigureElementFigure 1 *

updateDisplay

ScreenupdateDisplay

Screen

update

<<interface>>Observer

update

<<interface>>Observer

addObserverremoveObservernotify

<<interface>>Subject

addObserverremoveObservernotify

<<interface>>Subject

Métricas- Avaliação -

Estudos Empíricos- Padrões OO vs. Aspectos -

Abordagem Gerativa

- Ver Poster 12 -

Sistemas Multi-Agentes- O Domínio -

Método para SMAs

Agent

Observable

addLC()removeLC()notifyLC()

LMS

processInformation()getLR()…

LearningComponent

Role

collaboratingAgentscollaborationProtocolgetName()addAgent()removeAgent()…

Chair

paperslearningComponentssubmissionDeadlinereviewDeadlineaddLC()removeLC()notifyLC()distributeProposal()...

Reviewer

JADEAgent

getName()moveAgent()beforeMove()

UserAgent

researchInterestspublicationsreviewslearningComponentsaddPCparticipation()addLC()removeLC()notifyLC()…

Plan

goalagent…clone()execute ()…

CVUpdatePlan

learningComponentsaddLC()removeLC()notifyLC()execute ()updateCV()...

JudgementPlan JudgementReceptionPlan

learningRateprocessInformation()…

TD-Learning

processInformation()getTD()getReward()setReward()…

Strategypattern

learningComponentsaddLC()removeLC()notifyLC()execute ()evaluateResponse()...

– learning-specific members

– methods with some learning code

learning-specific classes

Co

llab

ora

tio

n

Learning

BasicConcerns

public Result judgeProposal(...) { ...lc.processInformation();...

}

Interaction

Observerpattern

Environment

... ...

Agenda

addAppointment()…

PersistentCV

addResearchKW()addPublication()addAward()addConference()…

DSInterface

getUserAnswer()getAnswerTime()… public void addPublication(...){

...sensor.senseEvent();...

}

Effector Sensor

receive()senseEvent()...

send()...

– interaction-specific members

– methods with some interaction code

interaction-specific classes

RevisionProposal

paperdeadlinescurrentPaperInterestproposalEvaluationisAccepted()…getPaperInterest()getEvaluation()…

goalsplanssensorseffectorsaddAgent()sendMsg()receiveMsg()…

Legend:

chairNamepapersToReviewlearningComponentssetChair()addLC()removeLC()notifyLC()returnJudgement()…

learningComponentsaddLC()removeLC()notifyLC()execute ()judgeProposal()emitJudgement()...

Padrões GoF

KnowledgeUpdating

BehaviorAdaptation

Kernel

Services

KnowledgeAdaptation

TravelingMessageReception

Interaction

Adaptation

GoalCreation

ExecutionAutonomy

Autonomy

RoleBinding

CollaborationProtocol

Collaboration

Mobility

Legend:

aspectual component

component

crosscutting interface

normal interface

MessageSending

Agenthood Additional Properties

ExtrinsicKnowledge

Answerer#4

ailabilityPlan

Agent

UserAgent

InformationAgent

InterfaceAgent

MiddleAgent

#2 Evolution and Reuse Scenario

#2

Plan

SearchingPlan

Knowledge

Proposal

AutonomyAutonomy

InteractionInteraction

CollaborationCollaboration

AdaptationAdaptation

EditorEditorContentContentSupplierSupplier

Caller#4

CounterProposal

System Viewpoint

0

10

20

30

40

50

60

70

80

90

100

Per

cen

tag

e

Patterns

Aspects

Answerer#4

ailabilityPlan

Agent

UserAgent

InformationAgent

InterfaceAgent

MiddleAgent

#2 Evolution and Reuse Scenario

#2

Plan

SearchingPlan

Knowledge

Proposal

AutonomyAutonomy

InteractionInteraction

CollaborationCollaboration

AdaptationAdaptation

EditorEditorContentContentSupplierSupplier

Caller#4

CounterProposal

0

2

4

6

8

10

12

14

16

18

20

Observer Subject Mediator Colleague Context Strategy Prototype

Nu

mb

er o

f O

per

atio

ns

Before After Before After Before After Before After Before After Before After Before After

ObserverPattern

MediatorPattern

StrategyPattern

PrototypePattern

-50%

+33%

+67%

+88%

0% 0%0%

+66%

-50%

+33%

+25%-40%

+29%

Nu

mb

ero

f O

per

atio

ns

+25%

AO

OO

50

43

Interação Adaptação Autonomia

Colaboração Mobilidade Aprendizagem

Modularização

Medição Medição

Comparação Comparação

paperInterestevaluation...

getInterest()...

LearningKnowledgeRevisionProposal

reviewerpaperdeadlinesisAccepted()getReviewer()getPaper()…

<< crosscuttinginterface >>

events_()

InformationGathering

<< crosscuttinginterface >>

InformationGathering

<< crosscuttinginterface >>

init()learn()adaptKnowledge()...

Learning

init()learn()getResponse()...

ReviewerLearning TDLearning

processInformation()getTD()getReward()setReward()…

Reviewer

UserAgent

JudgementPlan

execute()judgeProposal()...

LearningComponent

learningRateprocessInformation()...

*

events_()

Automatização Automatização

Auto

mati

zaçã

o

Referências

Refinam

ento

Refinam

ento

- Arquitetura -

- Projeto - - Implementação

-

Resultados Resultados

[1] A. GARCIA, C. SANT'ANNA, C. CHAVEZ, V. SILVA, C. LUCENA, A. STAA. Separation of Concerns in Multi-Agent Systems: An Empirical Study. In: Software Engineering for Multi-Agent Systems II, Springer, LNCS 2940, March 2004, pp. 49-72.

[2] A. GARCIA, C. LUCENA, D. COWAN. Agents in Object-Oriented Software Engineering. Software: Practice & Experience, Elsevier, 34(5): 489 - 521, May 2004.

[3] C. SANT'ANNA, A. GARCIA, C. CHAVEZ, C. LUCENA, A STAA. On the Reuse and Maintenance of Aspect-Oriented Software: An Assessment Framework. Proceedings of 17th Brazilian Symposium on Software Engineering, Manaus, Brazil, October 2003, pp. 19-34.

[4] C. SANT'ANNA, A. GARCIA, U. KULESZA, C. LUCENA, A. STAA. Design Patterns as Aspects: A Quantitative Assessment. Proceedings of the XIX Brazilian Symposium on Software Engineering, Brasília, Brazil, October 2004.

[5] A. GARCIA, U. KULESZA, C. LUCENA. Aspectizing Multi-Agent Systems: From Architecture to Implementation. In: “Software Engineering for Multi-Agent Systems III”, LNCS, Springer, December 2004. (To Appear)

[6] U. KULESZA, A. GARCIA, A. LUCENA, A. STAA. Integrating Generative and Aspect-Oriented Technologies. Proceedings of the XIX Brazilian Symposium on Software Engineering, Brasília, Brazil, October 2004.

Page 2: nomes teccomm.lesf.puc-rio.br/SoCAgents

Aspectos @ PUC-RioPUC-RioPUC-Rio