Jadex 0.96

jadex.examples.blackjack.player
Agent Player

jadex.examples.blackjack.player.Player
  • jadex.planlib.DF

  • agent Player
    contains jadex.planlib.DF


    Agent arguments:
    myself Player

    dealer AgentIdentifier

    The blackjack player agent.

    Player agents are supplied with a game strategy and will play with an initial amount of money (default is 100 credits).


    Belief Summary
    exported belief AgentIdentifier dealer
               The dealer where this player is currently playing.
    belief GameState gamestate
              
    belief HumanPlayerInterface gui
               The human player interface.
    exported belief Player myself
               The player's knowledge about itself, encapsulated as player object.
    belief long timeout
               The timeout used by the player.
     
    Goal Summary
    achievegoalref df_search
               Used to search for the dealer.
    maintaingoal know_dealer()
               Main goal of the player is to play games at a dealer.
    achievegoal start_playing()
              
     
    Plan Summary
    standard plan decline_game_plan()
               Plan to decline a game (only used when play_game_round_plan does not apply).
    standard plan join_game_plan()
               Plan to search for dealer and join a game.
    standard plan play_game_round_plan()
               Plan to play a single game.
    standard plan search_dealer_plan()
               Plan to search for dealer and join a game.
    standard plan update_game_state_plan(GameState gamestate)
              
     
    Event Summary
    messageevent action_done(Class content-class, String language, String ontology, String performative)
               Dealer informs about result of the game (e.g. amount of money won).
    messageevent inform_bet(Class content-class, String language, String ontology, String performative)
               Inform dealer about player bet.
    messageevent inform_game_state(Class content-class, String language, String ontology, String performative)
              
    messageevent refuse_bet(Class content-class, String language, String ontology, String performative)
              
    messageevent request_bet(Class content-class, String language, String ontology, String performative)
               Dealer queries for players bet.
    messageevent request_draw(Class content-class, String language, String ontology, String performative)
               Reuqest anothe rcard.
    messageevent request_finished(Class content-class, String language, String ontology, String performative)
               Request the game result.
    messageevent request_join(Class content-class, String language, String ontology, String performative, String reply-with)
              
     
    Expression Summary
    condition start_playing
              
     
    Configuration Summary
    default configuration  default
              
     

    Belief Detail

    myself

    exported belief Player myself
    The player's knowledge about itself, encapsulated as player object.

    Default fact:
    new Player($scope.getAgentName(), 100, Color.CYAN, AbstractStrategy.CONSTANT_VERY_CAREFUL)
    - Create deafult player object, when not passed as argument.

    dealer

    exported belief AgentIdentifier dealer
    The dealer where this player is currently playing.


    timeout

    belief long timeout
    The timeout used by the player.

    Default fact:
    0

    gui

    belief HumanPlayerInterface gui
    The human player interface.


    gamestate

    belief GameState gamestate
    Default fact:
    new GameState()
    Goal Detail

    start_playing

    achievegoal start_playing()
    BDI flags:
    retry: true
    retry delay: 0
    exclude: when_tried
    random selection: false
    post to all: false
    Context Condition:
    $beliefbase.myself.getAccount()>0
    Creation Condition:
    $beliefbase.dealer!=null
    Target Condition:
    $beliefbase.myself.getState().equals(Player.STATE_IDLE)

    know_dealer

    maintaingoal know_dealer()
    Main goal of the player is to play games at a dealer.

    BDI flags:
    retry: true
    retry delay: 0
    exclude: when_tried
    random selection: false
    post to all: false
    recur: true
    recur delay: 2000
    Maintain Condition:
    $beliefbase.dealer!=null
    Target Condition:
    $beliefbase.dealer!=null

    df_search

    achievegoalref df_search
    Used to search for the dealer.

    Parameters:
    parameterref constraints
    parameterref description
    parameterref df
    parameterset result
    Referenced from:
    df_search in capability jadex.planlib.DF
    Plan Detail

    search_dealer_plan

    standard plan search_dealer_plan()
    Plan to search for dealer and join a game.

    Plan body:
    Plan trigger:
    Goals:
    know_dealer

    join_game_plan

    standard plan join_game_plan()
    Plan to search for dealer and join a game.

    Plan body:
    Plan trigger:
    Goals:
    start_playing

    play_game_round_plan

    standard plan play_game_round_plan()
    Plan to play a single game.

    Plan body:
    Plan trigger:
    Message events:
    request_bet

    decline_game_plan

    standard plan decline_game_plan()
    Plan to decline a game (only used when play_game_round_plan does not apply).

    Plan body:
    Plan trigger:
    Message events:
    request_bet

    update_game_state_plan

    standard plan update_game_state_plan(GameState gamestate)
    Parameters:
    in parameter gamestate ( message event mappings: inform_game_state.content)
    Plan body:
    Plan trigger:
    Message events:
    inform_game_state
    Event Detail

    request_bet

    messageevent request_bet(Class content-class, 
                             String language, 
                             String ontology, 
                             String performative)
    Dealer queries for players bet.

    Parameters:
    fixed parameter content-class Default value:  RequestBet.class
    fixed parameter language Default value:  SFipa.NUGGETS_XML
    fixed parameter ontology Default value:  BlackjackOntology.ONTOLOGY_NAME
    fixed parameter performative Default value:  SFipa.REQUEST
    Event flags:
    direction: receive
    message type: fipa
    random selection: false
    post to all: false

    inform_game_state

    messageevent inform_game_state(Class content-class, 
                                   String language, 
                                   String ontology, 
                                   String performative)
    Parameters:
    fixed parameter content-class Default value:  GameState.class
    fixed parameter language Default value:  SFipa.NUGGETS_XML
    fixed parameter ontology Default value:  BlackjackOntology.ONTOLOGY_NAME
    fixed parameter performative Default value:  SFipa.INFORM
    Event flags:
    direction: receive
    message type: fipa
    random selection: false
    post to all: false

    action_done

    messageevent action_done(Class content-class, 
                             String language, 
                             String ontology, 
                             String performative)
    Dealer informs about result of the game (e.g. amount of money won).

    Parameters:
    fixed parameter content-class Default value:  Done.class
    fixed parameter language Default value:  SFipa.NUGGETS_XML
    fixed parameter ontology Default value:  BlackjackOntology.ONTOLOGY_NAME
    fixed parameter performative Default value:  SFipa.INFORM
    Event flags:
    direction: receive
    message type: fipa
    random selection: false
    post to all: false

    inform_bet

    messageevent inform_bet(Class content-class, 
                            String language, 
                            String ontology, 
                            String performative)
    Inform dealer about player bet.

    Parameters:
    fixed parameter content-class Default value:  Done.class
    - SFipa.createUniqueId($scope.getAgentName())
    fixed parameter language Default value:  SFipa.NUGGETS_XML
    fixed parameter ontology Default value:  BlackjackOntology.ONTOLOGY_NAME
    fixed parameter performative Default value:  SFipa.INFORM
    Event flags:
    direction: send
    message type: fipa
    random selection: false
    post to all: false

    refuse_bet

    messageevent refuse_bet(Class content-class, 
                            String language, 
                            String ontology, 
                            String performative)
    Parameters:
    fixed parameter content-class Default value:  RequestBet.class
    - SFipa.createUniqueId($scope.getAgentName())
    fixed parameter language Default value:  SFipa.NUGGETS_XML
    fixed parameter ontology Default value:  BlackjackOntology.ONTOLOGY_NAME
    fixed parameter performative Default value:  SFipa.REFUSE
    Event flags:
    direction: send
    message type: fipa
    random selection: false
    post to all: false

    request_draw

    messageevent request_draw(Class content-class, 
                              String language, 
                              String ontology, 
                              String performative)
    Reuqest anothe rcard.

    Parameters:
    fixed parameter content-class Default value:  RequestDraw.class
    fixed parameter language Default value:  SFipa.NUGGETS_XML
    fixed parameter ontology Default value:  BlackjackOntology.ONTOLOGY_NAME
    fixed parameter performative Default value:  SFipa.REQUEST
    Event flags:
    direction: send
    message type: fipa
    random selection: false
    post to all: false

    request_finished

    messageevent request_finished(Class content-class, 
                                  String language, 
                                  String ontology, 
                                  String performative)
    Request the game result.

    Parameters:
    fixed parameter content-class Default value:  RequestFinished.class
    - SFipa.createUniqueId($scope.getAgentName())
    fixed parameter language Default value:  SFipa.NUGGETS_XML
    fixed parameter ontology Default value:  BlackjackOntology.ONTOLOGY_NAME
    fixed parameter performative Default value:  SFipa.REQUEST
    Event flags:
    direction: send
    message type: fipa
    random selection: false
    post to all: false

    request_join

    messageevent request_join(Class content-class, 
                              String language, 
                              String ontology, 
                              String performative, 
                              String reply-with)
    Parameters:
    fixed parameter content-class Default value:  RequestJoin.class
    fixed parameter language Default value:  SFipa.NUGGETS_XML
    fixed parameter ontology Default value:  BlackjackOntology.ONTOLOGY_NAME
    fixed parameter performative Default value:  SFipa.REQUEST
    in parameter reply-with Default value:  SFipa.createUniqueId($scope.getAgentName())
    - Initialized with unique random value.
    Event flags:
    direction: send
    message type: fipa
    random selection: false
    post to all: false
    Expression Detail

    start_playing

    condition start_playing
    Expression:
    $beliefbase.myself.getCards().length==2 && $beliefbase.gamestate!=null && $beliefbase.gamestate.getDealer().getCards().length==1
    Configuration Detail

    default

    default configuration default
    Initial Beliefs:
    gui Initial value:   $beliefbase.myself.getStrategyName().equals(AbstractStrategy.HUMAN_PLAYER) ? new HumanPlayerInterface($beliefbase.myself, $beliefbase.gamestate, $agent.getExternalAccess()) : null
    Initial Goals:
    know_dealer

    Jadex 0.96

    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-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.