Jadex 0.96

jadex.examples.hunterprey.creature.preys.basicbehaviour
Capability BasicBehaviour

jadex.examples.hunterprey.creature.preys.basicbehaviour.BasicBehaviour
  • jadex.examples.hunterprey.creature.actsense.Creature
  • jadex.planlib.DF
  • jadex.planlib.Protocols
  • Direct Known Containing Agents:
    CleverPrey, LazyPrey

    capability BasicBehaviour
    contains Creature

    Basic wander, flee and eat behaviour for preys.

    Three goal types are supported:
    - Running away from hunters (maintain keep alone).
    - Eating food if discovered (achieve eat_food).
    - Searching for food (perform wander around).


    Belief Summary
    belief boolean eating_allowed
               Configuration belief stating if eating is allowed.
    exported beliefsetref food
               The know food.
    beliefset Food forbidden_food
               Forbidden food.
    exported beliefsetref hunters
               The known hunters.
    belief boolean is_indanger
               Is the prey in danger.
    exported abstract required beliefref Creature my_self
               The creature
    exported beliefsetref obstacles
               The know obstacles.
    exported beliefref vision
               The current vision.
     
    Goal Summary
    achievegoalref eat
              
    achievegoal eat_food(Food $food)
              
    achievegoal goto_location(Location location)
              
    maintaingoal keep_alone()
              
    achievegoalref move
              
    performgoal wander_around()
              
     
    Plan Summary
    standard plan eatfood(Food food)
               Dumb move plan.
    standard plan escape()
               Dumb move plan.
    standard plan gotoloc(Location location)
               Wander around plan.
    standard plan removeforbiddenfood()
              
    standard plan wander()
               Wander around plan.
     
    Configuration Summary
    default configuration  flee
              
    configuration  wander_flee_eat
              
     

    Belief Detail

    is_indanger

    belief boolean is_indanger
    Is the prey in danger.

    Default fact: (dynamic)
    $beliefbase.vision!=null && (select $object from $beliefbase.vision.getObjects() where $object instanceof Hunter).size()>0

    eating_allowed

    belief boolean eating_allowed
    Configuration belief stating if eating is allowed.

    Default fact:
    true

    forbidden_food

    beliefset Food forbidden_food
    Forbidden food.


    my_self

    exported abstract required beliefref Creature my_self
    The creature

    Assign to:
    my_self in capability Creature

    vision

    exported beliefref  vision
    The current vision.

    Referenced from:
    vision in capability Creature

    hunters

    exported beliefsetref  hunters
    The known hunters.

    Referenced from:
    hunters in capability Creature

    obstacles

    exported beliefsetref  obstacles
    The know obstacles.

    Referenced from:
    obstacles in capability Creature

    food

    exported beliefsetref  food
    The know food.

    Referenced from:
    food in capability Creature
    Goal Detail

    wander_around

    performgoal wander_around()
    BDI flags:
    retry: true
    retry delay: 0
    exclude: never
    random selection: false
    post to all: false

    eat_food

    achievegoal eat_food(Food $food)
    Parameters:
    in parameter $food Binding options:  $beliefbase.food
    BDI flags:
    retry: true
    retry delay: 0
    exclude: when_tried
    random selection: false
    post to all: false
    Uniqueness enabled:
    Creation Condition:
    $beliefbase.eating_allowed && !$beliefbase.getBeliefSet("forbidden_food").containsFact($food)
    Deliberation:
    inhibits wander_around
    inhibits eat_food
    $beliefbase.my_self.getDistance($goal.$food) < $beliefbase.my_self.getDistance($ref.$food)

    goto_location

    achievegoal goto_location(Location location)
    Parameters:
    in parameter location
    BDI flags:
    retry: true
    retry delay: 0
    exclude: when_tried
    random selection: false
    post to all: false

    keep_alone

    maintaingoal keep_alone()
    BDI flags:
    retry: true
    retry delay: 0
    exclude: never
    random selection: false
    post to all: false
    recur: false
    recur delay: 0
    Maintain Condition:
    !$beliefbase.is_indanger
    Target Condition:
    !$beliefbase.is_indanger
    Deliberation:
    inhibits eat_food
    inhibits wander_around

    move

    achievegoalref move
    Parameters:
    parameterref direction
    Referenced from:
    move in capability Creature

    eat

    achievegoalref eat
    Parameters:
    parameterref object
    Referenced from:
    eat in capability Creature
    Plan Detail

    gotoloc

    standard plan gotoloc(Location location)
    Wander around plan.

    Parameters:
    in parameter location (goal mappings: goto_location.location)
    Plan body:
    Plan trigger:
    Goals:
    goto_location

    wander

    standard plan wander()
    Wander around plan.

    Plan body:
    Plan trigger:
    Goals:
    wander_around

    escape

    standard plan escape()
    Dumb move plan.

    Plan body:
    Plan trigger:
    Goals:
    keep_alone

    eatfood

    standard plan eatfood(Food food)
    Dumb move plan.

    Parameters:
    in parameter food (goal mappings: eat_food.$food)
    Plan body:
    Plan trigger:
    Goals:
    eat_food

    removeforbiddenfood

    standard plan removeforbiddenfood()
    Plan body:
    Plan trigger:
    Belief change
    vision
    Configuration Detail

    flee

    default configuration flee
    Initial Beliefs:
    eating_allowed Initial value:  false
    Initial Goals:
    keep_alone

    wander_flee_eat

    configuration wander_flee_eat
    Initial Goals:
    wander_around
    keep_alone

    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.