Antonio Jose de Vasconcelos Costa - ajvc Breno Batista Machado - bbm Cleyton Mario de Oliveira...

Post on 07-Apr-2016

219 views 1 download

Transcript of Antonio Jose de Vasconcelos Costa - ajvc Breno Batista Machado - bbm Cleyton Mario de Oliveira...

Antonio Jose de Vasconcelos Costa - ajvcBreno Batista Machado - bbm

Cleyton Mario de Oliveira Rodrigues - cmorMarcos Aurelio Almeida da Silva - maas

Pablo Santana Barbosa – psbRenata Teles Moreira - rtm

Weslei Alvim de Tarso Marinho - watm

O que é Rollerslam? Características Estratégias Logging Dificuldades Estatísticas

Rollerslam!

Soccer

Handball

IceHockey

AustralianFootball

Basketball

Rugby

GaelicFootball

AmericanFootball

RollerDerby

Slamball

playerAgent1(teamA)

playerAgent20(teamA)

... playerAgent1(teamB)

playerAgent20(teamB)

...

gamePhysicsRulesSimulatorAgent

GameVisualizatio

nGUI

Agent ReasoningVisualization GUI

Rollerslam Simulation GUI

referee

Coach(teamA) Coach(teamB)

<<component>>Agent

effector sensor

EffectorSensor

<<interface>>Effector

+ doAction(ac:Message)

<<interface>>Sensor

+ getActions() : Message[0..*]

Message

+ sender : Agent

<<component>>Server

DisplayRegistry

AgentRegistry client

SimulationAdmin

ClientInitialization

AgentRegistryExt

ServerInitialization

serversimulation

agent[*] environment[1]

Effector Sensor

Effector SensorDisplayService

<<component>>Rollerslam

Display

<<component>>Rollerslam

Environment

effector sensor

SimulationStateProvider

simulation

initialization

<<component>>Rollerslam

Agent

effector sensor

simulation

initialization registrationdisplay

registration

Logginglogging

logginglogging logging

Agente GoalBased:◦ Jogadores;◦ Técnicos.

effector sensor simulation

<<component>>AutomataAgent

+ state : SimulationState

EnvironmentStateModel

worldModel

<<component>>GoalBasedAgent

GoalBasedEnvironment

StateModel

worldModel

GoalInitialization GoalUpdate

<<interface>>GoalInitialization

+ initialize(m:GoalBasedEnvironmentStateModel)

<<interface>>GoalUpdate

+ updateGoal(m:GoalBasedEnvironmentStateModel)

<<interface>> RamificationComponent

+processRamifications(world : EnvironmentStateMode)

Effector Sensor

effector sensor

SimulationStateProvider

simulation

<<component>>AutomataAgent

+ state : SimulationState# initialize()# think()

EnvironmentStateModelModelInitialization

ActionInterpretation

RamificationComponent

ModelBasedBehaviorStrategy

worldModel

Agente Autômato – O AmbienteAgente Autômato – O Ambiente

<<interface>>ModelInitialization

+ initialize(m:EnvironmentStateModel)

<<interface>> ActionInterpretation

+processAction(w:EnvironmentStateModel, m:Message)

<<interface>> ModelBasedBehaviorStrategy

+ computeAction(w:EnvironmentStateModel):Message

[not state = RUNNING]

self^initialize()

sensor.getActions()

s : Set of Message

s->forAll(x | actionInterpretation^processAction(worldModel,x))

modelBasedBehaviorStrategy^computeAction(worldModel)

action : Message

effector^doAction(action)

ramificationsComponent^processRamifications(worldModel)

self^think()

Comportamento do Comportamento do AmbienteAmbiente

Simulation

RollerslamMobileDisplay

MobileClient 1

MobileClient 2

MobileClient 3

RMI

Socket

SocketSocket

O que é? Características Estratégias Logging Dificuldades Estatísticas

As percepções que os agentes (player, coach e refeer) recebem é o modelo completo do ambiente, já que o ambiente é totalmente observável para todos os agentes.

As percepções que o agente environment recebe são as ações dos outros agentes.

As ações do agente player são:◦ Catch – Pegar a bola com as mãos;◦ Release – Soltar a bola;◦ Tackle – Derrubar outro jogador;◦ Countertackle – Defender de um Tackle de outro jogador;◦ Throw – Jogar a bola com as mãos;◦ Kick – Chutar a bola com os pés;◦ Hit – Chutar a bola de primeira;◦ Dash – Mover-se;◦ StandUp – Levantar-se;◦ SendMsg – Envia uma mensagem para outros agentes.

A ação dos agentes refeer e coach é: ◦ SendMsg – Envia uma mensagem para outros agentes.

A ação do agente environment é enviar o modelo do ambiente para os outros agentes.

O agente player considera: ◦ Seu objetivo inicial;◦ A posição da bola;◦ A posição dos jogadores;◦ Quem esta com a bola (time);◦ A função do jogador (papel que ele esta desempenhando no momento);◦ Ações de outros agentes.

O agente coach considera:◦ Seu objetivo inicial;◦ A posição da bola;◦ A posição dos jogadores;◦ Quem esta com a bola (time);◦ Placar do jogo (mudar a estratégia).

O agente refeer considera:◦ A posição da bola;◦ Quem esta com a bola (time).

O agente environment considera:◦ O estado atual do ambiente;◦ Ações recebidas dos agentes.

O agente player recebe as informações do agente coach com o seu papel. A partir daí o agente player toma as decisões de acordo com seu papel. O agente player recebe o modelo do ambiente (ambiente totalmente observável) como percepção, e a partir daí ele toma as decisões de acordo com o estado atual do modelo do ambiente, do objetivo do seu papel e das mensagens recebidas de outros agentes.

O agente refeer toma a decisão (gol ou não) de acordo com a posição da bola e quem está com a bola.

O agente coach recebe mensagens dos agentes players (que ainda não possuem um papel) e distribui um papel para estes de acordo com a ordem de envio das mensagens. Para as decisões de mudança de estratégia o agente coach considera quem (time) está com a bola, a posição dos jogadores e o placar do jogo.

O agente environment toma as decisões de mudança de estado do ambiente de acordo com as ações recebidas dos outros agentes.

As decisões são somente para a próxima ação, pois ele toma a decisão de acordo com o modelo atual do ambiente.

Todos os agentes estão totalmente cientes da presença dos outros agentes no ambiente, visto que o ambiente é totalmente observável.

As trocas de informações podem ser:◦ Mensagens de informações táticas e estratégicas

entre player e refeer;◦ As percepções entre environment e os outros

agentes;◦ As ações entre os outros agentes e o environment.

Eles se coordenam por partilha de tarefas, ao definir os papéis que cada jogador tem no jogo (responsabilidade do técnico). Após seu papel definido, irão agir independentes de acordo com seu papel, e as comunicações dos outros agentes. Não possui negociação, pois os jogadores são cooperativos. Não possuem aprendizagem.

É hibrida, pois é centralizada na distribuição dos papéis e na mudança de estratégia e emergente nos outros momentos.

Todos os players são iguais, mais eles agem de maneira diferente de acordo com os papéis atribuídos a eles, logo os direitos e deveres são diferenciados de acordo com o seu papel.

Os agentes player, coach e refeer são diferentes e possuem direitos e deveres diferentes.

Os objetivos individuais do agente (do seu papel) se complementam para atingir o objetivo geral do grupo.

Máquina de Estados

JOIN_GAME

WAIT_JOIN_GAME

send JoinGameAction/ INITIALIZATION[model->gameStarted]

SET_ROLES

send InitializationFact/

GO_TO_INIT_COORD

recv DefineRoleFact/STAND_UP

GO_TO_GOAL

GO_TO_BALL

STOP

[nearBall() and not me->inGround]

[insideArea(0.10) and not me->hasBall and not me->inGround and not nearBall()]

[me->inGround]

[me->hasBall and not me->inGround and not nearBall()]

WAIT_MOVIMENT

[nearBall()][not nearBall()]

[nearBall() and not me->inGround()]

send StandUpAction/

send DashAction/

send DashAction/

send DashAction/

[me->inGround]

send StandUpAction/

[not me->inGround]

[me->inGround]

send StandUpAction/

GO_TO_BALL

[not me->inGroundand not nearBall() and not veryNearBall()]

GO_TO_INIT_COORD

send DashAction/

STAND_UP[me->inGround]

send StandUpAction/

[not me->inGroundand veryNearBall()]

CATCH_BALL

TACKLE_PLAYER

[ball->withPlayer and playerWithBall.team = me.team]

[ball->withPlayer and playerWithBall.team <> me.team]

[not ball->withPlayer]

send DashAction/

send TackleAction/

send CatchAction/

CATCH_BALL

GO_TO_INIT_COOR

COUNTER_TACKLE

send CounterTackleAction/

[me->hasBall]

[not me->hasBall]

[nearOpponent()]

GO_TO_GOALsend DashAction/

[not nearOpponent()]

[playerWithBall.team = me.team]

send DashAction/

GO_TO_BALL

[playerWithBall.team <> me.team]

[nearBall()]

[not nearBall()]send DashAction/

send DashAction/

STAND_UP

[me->inGround]

send StandUpAction/

[not me->inGround]

TACKLE_PLAYER

GO_TO_BALL

GO_TO_INIT_COORD

send DashAction/

[nearBall()]

[not nearBall()]

send DashAction/

[playerWithBall.team <> me.team]

[playerWithBall.team = me.team]

send DashAction/

STAND_UP

[me->inGround]

send StandUpAction/

[not me->inGround]

STAND_UP

GO_TO_BALL

GO_TO_INIT_COORD

send DashAction/

[nearBall()]

[not nearBall()]

send DashAction/

[playerWithBall.team <> me.team]

[playerWithBall.team = me.team]

send DashAction/

STAND_UP

[me->inGround]

send StandUpAction/

[not me->inGround]

GO_TO_GOAL

[not me->inGroundand me->hasBall]

[nearBall()]

[not nearBall()]send DashAction/

send DashAction/

STAND_UPsend StandUpAction/

[me->inGround]GO_TO_BALL

[not me->inGroundand not me->hasBall]

GO_TO_INIT_COOR

[manyOponentsNear()]

send KickAction/

THROW_BALL

KICK_BALL[not manyOponentsNear()and nearGoal(50000)]

Near 50 meter (50000

millimeter)

[not manyOponentsNear()and nearGoal(30000)]

send KickAction/

Near 30 meter (30000

millimeter)

send ThrowAction/

THROW_BALL

[not me->inGroundand not playerWithBall.team = me.team]

[hasBall()]

[not hasBall()]send DashAction/

send DashAction/

STAND_UPsend StandUpAction/

[me->inGround]GO_TO_GOAL

[not me->inGroundand playerWithBall.team = me.team]

GO_TO_INIT_COOR

GO_TO_BALL

[not nearBall()]send DashAction/

[nearBall()]

send DashAction/

THROW_BALL

[not me->inGroundand not playerWithBall.team = me.team]

[hasBall()]

[not hasBall()]send DashAction/

send DashAction/

STAND_UPsend StandUpAction/

[me->inGround]GO_TO_GOAL

[not me->inGroundand playerWithBall.team = me.team]

GO_TO_INIT_COOR

GO_TO_BALL

[not nearBall()]send DashAction/

[nearBall()]

send DashAction/

COUNTER_TACKLE

STAND_UPsend StandUpAction/

[me->inGround]

GO_TO_GOAL[not me->inGroundand me.hasBall]

GO_TO_INIT_COOR

GO_TO_BALL

[not nearBall()]send DashAction/

[nearBall()]

send DashAction/

[not me->inGroundand not me.hasBall]

Máquina de Estados

WAIT_JOIN_GAME LISTENING

[model->gameStarted]

SET_POSITION

[receiveAgentInitMsg()]

CHANGE_DEFENSIVE_POSITION

send SendMsgAction/

CHANGE_OFFENSIVE_POSITION

[not receiveAgentInitMsg()]

[teamWinning() andnot teamLosing()]

[teamLosing() andnot teamWinning()]

send SendMsgAction/

send SendMsgAction/GO_TO_BALL

[not teamLosing() andnot teamWinning() and manyEnemyNearBall()]

send SendMsgAction/

O que é Rollerslam? Características Estratégias Logging Dificuldades Estatísticas

TraceQuery

Team

Reasoning ServiceNon-Reasoning Service

Simulation

Component

1..*

Algorithmic Workflow Object-Oriented Rule

1..*1..*

Imperative Object Logical Object Molecule

1..* 1..*

Logical Constraint Atom

1..*

TracerDriver

Agent

1..*

Service

1..*

Additional Data

Minimal Trace Event

OO Rule Firing Level

Reasoning Trace

Logical ObjectInheritance LevelReasoning Trace

Justification-BasedLogical Constraint

Matching/Entailment LevelReasoning Trace

Service LevelReasoning Trace

Agent LevelReasoning Trace

Simulation LevelReasoning Trace

IntegratedMulti-

GranularityReasoning

Trace Query &

VisualizationGUI

User

Trace Query

Logging – Trace Driver

LogRecordingService

<<component>>LogRecorder

LogRecordingServiceImpl

SimulationDescription

<<delegate>>

Log PlayingService

<<component>>LogPlayer

LogPlayerImpl--------------------------------+ currentCycle : Integer

SimulationDescription

<<delegate>>

<<window>>LogPlayerDisplay

<<Button>>LoadSimulation

<<frame>>GameCanvas

<<Text>>CurrentCycle

<<Slider>>CurrentCycleSlider

<<Text>>Speed

<<Slider>>SpeedSlider

<<Button>>Run

<<ComboBox>>AgentFilter

<<ComboBox>>MessageTypeFilter

<<Button>>Show

<<Text>>Messages

<<FileChooser>>SelectSimulation

O que é Rollerslam? Características Estratégias Dificuldades Estatísticas

Laboratórios cheios Problemas relativos a distribuição Máquinas diferentes nos laboratórios

◦ IP fora do padrão◦ DNS não funciona◦ Muito lenta

Uso de:◦ CHR◦ FLUX

Trace Driver

O que é Rollerslam? Características Estratégias Dificuldades Estatísticas

Arquivos: ~650 arquivos Linhas de código: ~6000 Commits: ~600 Slides (documentação): ~300 Reuniões: ~60

Por que aproximadamente?◦ Está sempre sendo atualizado, quando você ler isto, os números já estarão diferentes

http://rollerslam.googlecode.com