jadex.testcases.goals
Agent GoalRegressionTest
- agent GoalRegressionTest
 
Test different behaviours of goals.
 This agent tests several goals and checks for correct results
 using the GoalRegressionTestPlan.
 The agent has some initial goals, which
 specify the expected result state, and the
 result states of all executed plans (process goals).
 The GoalRegressionTestPlan reads this information
 and checks, wether the actual goal history of a finished goal
 matches the expected result.
 The following tests are performed (see initial goals):
 testachievesuccess: Processing an achieve goal should stop when one plan
  finishes successfully.
 testpriority: Plan with higher priority should be selected first
  (first plan fails, second succeeds).
 testperformsuccess: Perform goal should continue after
  one plan has succeeded (last process states will also be SUCCEEDED).
 testperformfailure: Perform goal should fail when no plan is applicable.
 testbinding: Two plans with different final state should be executed
  according to the binding expression of the MPlan (see bindplan).
| Goal Summary | 
| achievegoal  | testachievesuccess(boolean[] test_process_states, boolean test_state)
 | 
| achievegoal  | testbinding(boolean[] test_process_states, boolean test_state)
 | 
| performgoal  | testperformfailure(boolean[] test_process_states, boolean test_state)
 | 
| performgoal  | testperformsuccess(boolean[] test_process_states, boolean test_state)
 | 
| achievegoal  | testpriority(boolean[] test_process_states, boolean test_state)
 | 
 
| Plan Summary | 
| standard plan  | bindplan(boolean targetstate)
 | 
| standard plan  | one()
 | 
| standard plan  | regtest()
 | 
| standard plan  | three()
 | 
| standard plan  | two()
 | 
 
| Initial State Summary | 
| default initial state  | default
 | 
 
testperformsuccess
performgoal testperformsuccess(boolean[] test_process_states, 
                               boolean test_state)
- 
- Parameters:
- inout parameter test_process_states
- inout parameter test_stateDefault value:false
- BDI flags:
- retry: true- retry delay: 0- exclude: when_tried- random selection: false- meta-level reasoning: true- post to all: false
 
testperformfailure
performgoal testperformfailure(boolean[] test_process_states, 
                               boolean test_state)
- 
- Parameters:
- inout parameter test_process_states
- inout parameter test_stateDefault value:false
- BDI flags:
- retry: true- retry delay: 0- exclude: when_tried- random selection: false- meta-level reasoning: true- post to all: false
 
testachievesuccess
achievegoal testachievesuccess(boolean[] test_process_states, 
                               boolean test_state)
- 
- Parameters:
- inout parameter test_process_states
- inout parameter test_stateDefault value:false
- BDI flags:
- retry: true- retry delay: 0- exclude: when_tried- random selection: false- meta-level reasoning: true- post to all: false
 
testpriority
achievegoal testpriority(boolean[] test_process_states, 
                         boolean test_state)
- 
- Parameters:
- inout parameter test_process_states
- inout parameter test_stateDefault value:false
- BDI flags:
- retry: true- retry delay: 0- exclude: when_tried- random selection: false- meta-level reasoning: true- post to all: false
 
testbinding
achievegoal testbinding(boolean[] test_process_states, 
                        boolean test_state)
- 
- Parameters:
- inout parameter test_process_states
- inout parameter test_stateDefault value:false
- BDI flags:
- retry: true- retry delay: 0- exclude: when_tried- random selection: false- meta-level reasoning: true- post to all: false
 
regtest
standard plan regtest()
- 
- Plan body:
- new GoalRegressionTestPlan()
- Filter
- new GoalEventFilter(null, true)
 
one
standard plan one()
- 
- Plan body:
- new ResultPlan(50, true)
- Goal Trigger:
- testachievesuccess
- Goal Trigger:
- testperformsuccess
- Goal Trigger:
- testpriority
 
two
standard plan two()
- 
- Plan body:
- new ResultPlan(250, false)
- Goal Trigger:
- testachievesuccess
- Goal Trigger:
- testperformsuccess
- Goal Trigger:
- testpriority
 
three
standard plan three()
- 
- Plan body:
- new ResultPlan(500, true)
- Goal Trigger:
- testachievesuccess
- Goal Trigger:
- testperformsuccess
- Goal Trigger:
- testpriority
 
bindplan
standard plan bindplan(boolean targetstate)
- 
- Parameters:
- in parameter targetstateDefault value:false
- Plan body:
- new ResultPlan(500, $plan.targetstate)
- Goal Trigger:
- testbinding
 
default
default initial state default
- 
- Initial Goals:
- testachievesuccess (test_state=true, test_process_states=new boolean[]{false, true})
- testpriority (test_state=true, test_process_states=new boolean[]{false, true})
- testperformsuccess (test_state=true, test_process_states=new boolean[]{false, true, true})
- testperformfailure (test_state=false, test_process_states=new boolean[0])
- testbinding (test_state=true, test_process_states=new boolean[]{false, true})
 
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.