Jadex 0.941

jadex.examples.puzzle.mobile
Agent Sokrates


agent Sokrates

Puzzling mobile agent.

This agent that plays a board game for one player. This example is a Jadex adaption of the original JACK(TM) puzzle example and was used for performance comparisons between both platforms (cf. readme.txt). This version uses mobile plans and therefore incurs no overhead for thread switching (faster than the benchmarked version).


Belief Summary
belief IBoard board
           The game board offers possibilities to make moves, take back moves and keep track of the game history.
belief String ml
           The meta-level strategy for choosing moves (none=choose the first applicable, long=prefer jump moves, same_long=prefer long moves of same color, alter_long=prefer long move of alternate color.
belief Long move_delay
           The delay in milliseconds between two moves.
belief Integer triescnt
           The number of moves already tried.
 
Goal Summary
metagoal choosemove(ICandidateInfo [set] applicables, ICandidateInfo [set] result)
           The meta-level goal for choosing between plans for the makemove goal.
achievegoal makemove(Integer depth)
           The goal to make a move on the board that is the solution.
 
Plan Summary
mobile plan choose_move_plan(ICandidateInfo [set] applicables, ICandidateInfo [set] result)
           Meta-level plan used to choose among the possible move plans.
mobile plan gui()
           Create and show the gui.
mobile plan move_plan(Integer depth, Move move)
           Make a move on the board and create a subgoal for the next move.
mobile plan play_game_plan()
           Start puzzling on the board and measure the needed time.
 
Initial State Summary
initial state  3x3 board (no solution)
          
default initial state  5x5 board (standard)
          
initial state  7x7 board (takes quite long)
          
initial state  9x9 board (takes very long)
          
initial state  jack-5x5
          
 

Belief Detail

board

belief IBoard board
The game board offers possibilities to make moves, take back moves and keep track of the game history.


triescnt

belief Integer triescnt
The number of moves already tried.

Default fact:
0

move_delay

belief Long move_delay
The delay in milliseconds between two moves.

Default fact:
500

ml

belief String ml
The meta-level strategy for choosing moves (none=choose the first applicable, long=prefer jump moves, same_long=prefer long moves of same color, alter_long=prefer long move of alternate color.

Default fact:
"same_long"
Goal Detail

makemove

achievegoal makemove(Integer depth)
The goal to make a move on the board that is the solution.

Parameters:
in parameter depth
BDI flags:
retry: true
retry delay: 0
exclude: when_tried
random selection: false
meta-level reasoning: true
post to all: false
Target Condition:
$beliefbase.board.isSolution()

choosemove

metagoal choosemove(ICandidateInfo [set] applicables, 
                    ICandidateInfo [set] result)
The meta-level goal for choosing between plans for the makemove goal.

Parameters:
in parameterset applicables
out parameterset result
BDI flags:
retry: true
retry delay: 0
exclude: when_tried
random selection: false
meta-level reasoning: true
post to all: false
Goal Trigger:
makemove
Plan Detail

play_game_plan

mobile plan play_game_plan()
Start puzzling on the board and measure the needed time.

Plan body:
new PlayGamePlan()

move_plan

mobile plan move_plan(Integer depth, 
                     Move move)
Make a move on the board and create a subgoal for the next move.

Parameters:
in parameter depth (goal mappings: makemove.depth)
in parameter move Binding options:  $beliefbase.board.getPossibleMoves()
Plan body:
new MovePlan()
Goal Trigger:
makemove

choose_move_plan

mobile plan choose_move_plan(ICandidateInfo [set] applicables, 
                            ICandidateInfo [set] result)
Meta-level plan used to choose among the possible move plans.

Parameters:
in parameterset applicables (goal mappings: choosemove.applicables)
out parameterset result (goal mappings: choosemove.result)
Plan body:
new ChooseMovePlan()
Goal Trigger:
choosemove

gui

mobile plan gui()
Create and show the gui.

Plan body:
new GUIPlan()
Initial State Detail

3x3 board (no solution)

initial state 3x3 board (no solution)
Initial Beliefs:
board Initial value:  new Board(3)
Initial Plans:
gui
play_game_plan

5x5 board (standard)

default initial state 5x5 board (standard)
Initial Beliefs:
board Initial value:  new Board(5)
Initial Plans:
gui
play_game_plan

7x7 board (takes quite long)

initial state 7x7 board (takes quite long)
Initial Beliefs:
board Initial value:  new Board(7)
Initial Plans:
gui
play_game_plan

9x9 board (takes very long)

initial state 9x9 board (takes very long)
Initial Beliefs:
board Initial value:  new Board(9)
Initial Plans:
gui
play_game_plan

jack-5x5

initial state jack-5x5
Initial Beliefs:
board Initial value:  new JackBoard()
Initial Plans:
gui
play_game_plan

Jadex 0.941

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2005 Lars Braubach, Alexander Pokahr, Andrzej Walczak - University of Hamburg. Use is subject to license terms.