top level and infrastructure components maurelio & doleron

41
Top Level and Infrastructure Components maurelio & doleron

Post on 15-Jan-2016

220 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Top Level and Infrastructure Components maurelio & doleron

Top Level and Infrastructure Components

maurelio & doleron

Page 2: Top Level and Infrastructure Components maurelio & doleron

Rollerslam 2.0 x 1.0

• Pros– Efficiency in communication– 100% Prolog/FLUX Player Specification– Communicative Actions– PIM-Code Compatibility

• Cons– No distribution

Page 3: Top Level and Infrastructure Components maurelio & doleron

Top Level

Display

GamePhysics

Player

SimulationInfrastructure

FluxCommunicativeAgent

Overview

Page 4: Top Level and Infrastructure Components maurelio & doleron

Ideal PSM components dependecy

Page 5: Top Level and Infrastructure Components maurelio & doleron

Top Level

Display

GamePhysics

Player

SimulationInfrastructure

CommunicativeAgent

FluxCommunicativeAgent

FluxInferenceEngineEclipsePrologJava Bridge

API

Page 6: Top Level and Infrastructure Components maurelio & doleron

Real PSM components dependecy

Page 7: Top Level and Infrastructure Components maurelio & doleron

Top Level

Display

GamePhysics

Player

SimulationInfrastructure

CommunicativeAgent

FluxCommunicativeAgent

FluxInferenceEngineEclipsePrologJava Bridge

API

Page 8: Top Level and Infrastructure Components maurelio & doleron

Top LevelPIM

Page 9: Top Level and Infrastructure Components maurelio & doleron

Specification

Page 10: Top Level and Infrastructure Components maurelio & doleron

Specification Service View

<<K2SubjCompoClassSSV>>Rollerslam

<<K2Realiz>>

<<K2ISSV>>SimulationAdmin

---------------------------------------

+ setState(s:SimulationState)+ getState() : SimulationState

simAdmin

Page 11: Top Level and Infrastructure Components maurelio & doleron

Specification Type View

<<K2Enum>>SimulationState

-----------------------INITIALIZEDPAUSEDRUNNING

Page 12: Top Level and Infrastructure Components maurelio & doleron

Specification Operation View

context Rollerslam::setState(s:SimulationState) post: getState() = s 

Page 13: Top Level and Infrastructure Components maurelio & doleron

Realization

Page 14: Top Level and Infrastructure Components maurelio & doleron

<<K2SubjCompoClassRSV>>Rollerslam

-----------------------------------------------------------------------------------------------------------------------------

Realization Service View

<<K2CompoClassRSV>>

SimulationInfrastructure

<<K2IRSV>>SimulationAdmin

<<K2Realiz>>

<<K2IRSV>>Agent

*

<<K2CompoClassRSV>>Player

<<K2CompoClassRSV>>Referee

<<K2CompoClassRSV>>GamePhysics

<<K2Realiz>>

<<K2Use>>

agents

<< K2CompoClassRSV >>Display

Page 15: Top Level and Infrastructure Components maurelio & doleron

<<K2SubjCompObjRIV>>: Rollerslam

-----------------------------------------------------------------------------------------------------------------------------

Realization Instance View

infra: SimulationInfrastructure

: Display

: SimulationAdmin

<<K2RealizeLink>>

<<K2UseLink>>

: GamePhysics : Referee : Player : Player...

gfa : Agent r : Agent p1 : Agent p40 : Agent

<<K2RealizeLink>>

<<K2UseLink>>

<<K2UseLink>> <<K2UseLink>> <<K2UseLink>> <<K2UseLink>>

<<K2RealizeLink>>

<<K2RealizeLink>>

Page 16: Top Level and Infrastructure Components maurelio & doleron

Realization Operation View

context Rollerslam::setState(s:SimulationState) post: infra.setState(s)

context SimulationIntrastructure::getState() : SimulationState body: infra.getState()

Page 17: Top Level and Infrastructure Components maurelio & doleron

SimulationInfrastructure

PIM

Page 18: Top Level and Infrastructure Components maurelio & doleron

Specification

Page 19: Top Level and Infrastructure Components maurelio & doleron

Specification Service View

<<K2SubjCompoClassSSV>>Simulation

Infrastructure

<<K2Realize>>

*<<K2Realize>> agent

<<K2ISSV>> Agent--------------------------------------------------------+ getAgentID() : AgentID+ sendActions(actions:Message[*])+ getPerceptions() : Message[*]+ getSimulationState() : SimulationState

<<K2ISSV>>SimulationAdmin

---------------------------------------+ setState(s:SimulationState)+ getState() : SimulationState

simAdmin

simulation

Page 20: Top Level and Infrastructure Components maurelio & doleron

Specification Service ViewInvariants

context Agent inv:getSimulationState() = simulation.simAdmin.getState()

context SimulationInfrastructure inv:agents.getAgentID()->forAll( id | agents->select(getAgentID() = id)->size() = 1)

Page 21: Top Level and Infrastructure Components maurelio & doleron

Specification Type View

<<K2Enum>>SimulationState

-----------------------INITIALIZEDPAUSEDRUNNING

<<K2Class>>Message

-----------------------+ sender: AgentID+ receiver: AgentID[*]

<<K2Class>>AgentID

Page 22: Top Level and Infrastructure Components maurelio & doleron

Specification Life Cycle View

RUNNING PAUSED

setSimulationState(PAUSED)

setSimulationState(RUNNING)

INITIALIZED

setSimulationState(INITIALIZED)

setSimulationState(RUNNING)

setSimulationState(RUNNING)

Page 23: Top Level and Infrastructure Components maurelio & doleron

Specification Operation View

context SimulationAdmin::setState(s:SimulationState) post: getState() = s 

Page 24: Top Level and Infrastructure Components maurelio & doleron

Realization

Page 25: Top Level and Infrastructure Components maurelio & doleron

Realization Service View

<<K2Component>> Simulation Infrastructure---------------------------------- state : SimulationState---------------------------------+ setState(s:SimulationState)+ getState() : SimulationState

<<interface>>

SimulationAdmin

Messagemsgs

*

Page 26: Top Level and Infrastructure Components maurelio & doleron

Realization Operation View

context SimulationInfrastructure::setState(s:SimulationState) post: state = s

context SimulationIntrastructure::getState() : SimulationState body: state

context Agent::sendActions(actions : Message[*])post: simulation.msgs = simulation.msgs->including(actions)

context Agent::receivePercepts() : Message[*]body: result = simulation.msgs-> select(x|x.receiver->includes(self.getAgentID())

Page 27: Top Level and Infrastructure Components maurelio & doleron

Communicative Agent

PIM

Page 28: Top Level and Infrastructure Components maurelio & doleron

Specification

Page 29: Top Level and Infrastructure Components maurelio & doleron

Specification Service View

<<K2SubjCompoClassSSV>>Communicative

Agent

<<K2Use>>

<<K2ISSV>>Agent

<<K2Class>>OOState

<<K2Class>>OOState

AgentID

agentKB

kb

Page 30: Top Level and Infrastructure Components maurelio & doleron

Specification Type View

<<K2Class>>OOState

<<K2Class>>WorldObject

*

<<K2Class>>OID

<<K2Class>>StringOID

----------------------------+ oid : String

<<K2Class>>ObjectState

<<K2Class>>AgentID

(from Infra)

<<K2Class>>Communicative

AgentID------------------+ myID : String

Page 31: Top Level and Infrastructure Components maurelio & doleron

Specification Type View

<<K2Class>>Message

(from Infra)

<<K2Class>>AskAction

------------------+ oids : OID[*]

<<K2Class>>TellAction

------------------+ objects :

WorldObject[*]

<<K2Class>>AskAllAction

Page 33: Top Level and Infrastructure Components maurelio & doleron

Realization Service View

<<K2SubjCompoClassRSV>>Communicative

Agent---------------------------------------------------------------# processCycle(messages : Message[*]) : Message

<<K2Class>>Message

actions

*

Page 34: Top Level and Infrastructure Components maurelio & doleron

Realization Algorithmic View

actions = processCycle(agent.getPerceptions())

agent.sendActions(actions)

[not actions.isEmpty()]

Page 35: Top Level and Infrastructure Components maurelio & doleron

processCycle(messages : Message[*]) : Message

agentKB(sender).worldObject->includes(m.objects)

foreach message m in messages

[m.oclIsKindOf(TellAction)]

ret.oclIsKindOf(AskAction) andret.objects = kb.objects->

select(x |m.objects->includes(x.oid))

ret.oclIsKindOf(AskAction) andret.objects = kb.objects

[m.oclIsKindOf(AskAction)]

[m.oclIsKindOf(AskAllAction)]

Page 36: Top Level and Infrastructure Components maurelio & doleron

Discussion

• Negative aspects– Zero test scenarios– incomplete non-functional analisys (stress &

code-compliance)– Late project integration (Flux comunicative

approach)– No object-funcional abstract layer mapping

Page 37: Top Level and Infrastructure Components maurelio & doleron

Discussion

• Positive aspects– Peformance improvement sense– Code improvements with refactorings– Team knowledge improvement – Flux player implementation– Improvements render strategy to 2D&1/2

renderization

Page 38: Top Level and Infrastructure Components maurelio & doleron

Test Scenarios

Page 39: Top Level and Infrastructure Components maurelio & doleron

Test Scenarios

What the player behavior in this case?

Page 40: Top Level and Infrastructure Components maurelio & doleron

Test Scenarios

And now?

Page 41: Top Level and Infrastructure Components maurelio & doleron

Future Work

• Object-Funcional framework

• Quantitative metrics to decision support

• Scenarios automatic testing

• Continuous integration

• Artfacts automatic synchronization with tool support