top level and infrastructure components maurelio & doleron
Post on 15-Jan-2016
220 views
TRANSCRIPT
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
Top Level
Display
GamePhysics
Player
SimulationInfrastructure
FluxCommunicativeAgent
Overview
Ideal PSM components dependecy
Top Level
Display
GamePhysics
Player
SimulationInfrastructure
CommunicativeAgent
FluxCommunicativeAgent
FluxInferenceEngineEclipsePrologJava Bridge
API
Real PSM components dependecy
Top Level
Display
GamePhysics
Player
SimulationInfrastructure
CommunicativeAgent
FluxCommunicativeAgent
FluxInferenceEngineEclipsePrologJava Bridge
API
Top LevelPIM
Specification
Specification Service View
<<K2SubjCompoClassSSV>>Rollerslam
<<K2Realiz>>
<<K2ISSV>>SimulationAdmin
---------------------------------------
+ setState(s:SimulationState)+ getState() : SimulationState
simAdmin
Specification Type View
<<K2Enum>>SimulationState
-----------------------INITIALIZEDPAUSEDRUNNING
Specification Operation View
context Rollerslam::setState(s:SimulationState) post: getState() = s
Realization
<<K2SubjCompoClassRSV>>Rollerslam
-----------------------------------------------------------------------------------------------------------------------------
Realization Service View
<<K2CompoClassRSV>>
SimulationInfrastructure
<<K2IRSV>>SimulationAdmin
<<K2Realiz>>
<<K2IRSV>>Agent
*
<<K2CompoClassRSV>>Player
<<K2CompoClassRSV>>Referee
<<K2CompoClassRSV>>GamePhysics
<<K2Realiz>>
<<K2Use>>
agents
<< K2CompoClassRSV >>Display
<<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>>
Realization Operation View
context Rollerslam::setState(s:SimulationState) post: infra.setState(s)
context SimulationIntrastructure::getState() : SimulationState body: infra.getState()
SimulationInfrastructure
PIM
Specification
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
Specification Service ViewInvariants
context Agent inv:getSimulationState() = simulation.simAdmin.getState()
context SimulationInfrastructure inv:agents.getAgentID()->forAll( id | agents->select(getAgentID() = id)->size() = 1)
Specification Type View
<<K2Enum>>SimulationState
-----------------------INITIALIZEDPAUSEDRUNNING
<<K2Class>>Message
-----------------------+ sender: AgentID+ receiver: AgentID[*]
<<K2Class>>AgentID
Specification Life Cycle View
RUNNING PAUSED
setSimulationState(PAUSED)
setSimulationState(RUNNING)
INITIALIZED
setSimulationState(INITIALIZED)
setSimulationState(RUNNING)
setSimulationState(RUNNING)
Specification Operation View
context SimulationAdmin::setState(s:SimulationState) post: getState() = s
Realization
Realization Service View
<<K2Component>> Simulation Infrastructure---------------------------------- state : SimulationState---------------------------------+ setState(s:SimulationState)+ getState() : SimulationState
<<interface>>
SimulationAdmin
Messagemsgs
*
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())
Communicative Agent
PIM
Specification
Specification Service View
<<K2SubjCompoClassSSV>>Communicative
Agent
<<K2Use>>
<<K2ISSV>>Agent
<<K2Class>>OOState
<<K2Class>>OOState
AgentID
agentKB
kb
Specification Type View
<<K2Class>>OOState
<<K2Class>>WorldObject
*
<<K2Class>>OID
<<K2Class>>StringOID
----------------------------+ oid : String
<<K2Class>>ObjectState
<<K2Class>>AgentID
(from Infra)
<<K2Class>>Communicative
AgentID------------------+ myID : String
Specification Type View
<<K2Class>>Message
(from Infra)
<<K2Class>>AskAction
------------------+ oids : OID[*]
<<K2Class>>TellAction
------------------+ objects :
WorldObject[*]
<<K2Class>>AskAllAction
Realization Service View
<<K2SubjCompoClassRSV>>Communicative
Agent---------------------------------------------------------------# processCycle(messages : Message[*]) : Message
<<K2Class>>Message
actions
*
Realization Algorithmic View
actions = processCycle(agent.getPerceptions())
agent.sendActions(actions)
[not actions.isEmpty()]
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)]
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
Discussion
• Positive aspects– Peformance improvement sense– Code improvements with refactorings– Team knowledge improvement – Flux player implementation– Improvements render strategy to 2D&1/2
renderization
Test Scenarios
Test Scenarios
What the player behavior in this case?
Test Scenarios
And now?
Future Work
• Object-Funcional framework
• Quantitative metrics to decision support
• Scenarios automatic testing
• Continuous integration
• Artfacts automatic synchronization with tool support