Title: Minesweeper example
1Minesweeper example
- MAS course
- Ramon F. Brena
2Minesweeper
3Environment perspective
4Minesweeper Environment
- Board will be managed by an agent
- Controller agent
- There will be one agent for each square in the
grid - Solver agents
5Organizational Perspective
Controller
Solvers
6Roles
- Controller
- Consults and modifies squares status
- Responds to solver queries, giving information
about the result of an action - Solver
- Proposes actions on the grid (stomp, mark)
- Ask neighbor solvers about their status
- Discusses with other solvers
7Controller role
- Permissions
- Read square (i,j) public status in
- Unknown (covered)
- 0 8 (bombs near)
- Read square (I,j) hidden status in
- Free
- Bomb
- Modify public status from Unknown to 0..8
8Controller role
- Responsibilities
- Liveness properties
- (PerformStompMark)? Win Lose
- Safety properties
- Maintain board coherence (e.g. no 2 is near 3
bombs, etc.) - Do not accept solutions after Lose
9Solver Role
- No permissions
- Responsibilities
- Liveness
- (ConsultNeighStatus PerformStomp Mark) ?
- Safety
- Do not stomp unless sure or stuck
10PerformStomp Protocol
- Description
- A solver agent decides to stomp, and communicates
its decision to the controller. The controller
performs a stomping action and returns the
resulting status to the solver. - Initiator A solver
- Respondent The controller
11PerformStomp Protocol
- Inputs (information used by the role initiator
while enacting the protocol) - Solvers position / identity
- Outputs (information supplied by the protocol
responder during interaction) - Solvers new status
12PerformStomp diagram
Protocol Name PerformStomp
InputSolvers (I,j)
Initiator A Solver
Respondent Controller
OutputSolvers new status
Description A solver agent decides to stomp, and
communicates its decision to the controller. The
controller performs a stomping action and returns
the resulting status to the solver
13ConsultNeighStatus
Protocol Name ConsultNeighStatus
InputSolvers (I,j)
Initiator Solver (i,j)
Respondent Solver (n,m)
OutputSolver (n,m) status
Description A solver agent in position (I,j)
asks agent in position (n,m) about its status,
and a corresponding answer is issued by solver at
(n,m)
14ConsultNeighStatus issues
- Is it possible to ask about a distant solver
status? - If NO, how this restriction is enforced?
- Other possibility is to ask the controller, not
other solvers
15Initialization issues
- How to start the game?
- What solver is going to stomp first?
- At startup, solvers could wait a random amount of
time, then ask for a reservation to stomp first
to all other solvers - When a reservation demand is received, no other
reservation is demanded, and a warrant is issued
16FirstStomp protocol
Protocol Name FirstStomp
InputSolvers (I,j)
Initiator Solver (i,j)
Respondent Solver (n,m)
OutputWarrant from (n,m)Confirmation from (i,j)
Description A solver agent tries to be the first
to stomp on the grid, so asks other solvers to
refrain from doing so and to give a warrant
17Refinement cycle
Roles' Protocols and Activities
Protocols details
18Other issues
- User interface
- Could be part of Controller
- Could include a step button
- Game termination
- Win-related protocols
- Lose-related protocols
- Harder situations (not locally solvable)