diff --git a/alica_tests/etc/behaviours/AccessAsAnyTestBeh.beh b/alica_tests/etc/behaviours/AccessAsAnyTestBeh.beh new file mode 100644 index 000000000..856c163eb --- /dev/null +++ b/alica_tests/etc/behaviours/AccessAsAnyTestBeh.beh @@ -0,0 +1,16 @@ +{ + "blackboard": [], + "comment": "", + "deferring": 0, + "eventDriven": false, + "frequency": 5, + "id": 103008403659174438, + "implementationName": "", + "inheritBlackboard": false, + "libraryName": "alica-tests", + "name": "AccessAsAnyTestBeh", + "postCondition": null, + "preCondition": null, + "runtimeCondition": null, + "variables": [] +} diff --git a/alica_tests/etc/behaviours/BlackboardExceptionTestBeh.beh b/alica_tests/etc/behaviours/BlackboardExceptionTestBeh.beh new file mode 100644 index 000000000..8875cdf5d --- /dev/null +++ b/alica_tests/etc/behaviours/BlackboardExceptionTestBeh.beh @@ -0,0 +1,52 @@ +{ + "blackboard": [ + { + "access": "protected", + "comment": "", + "id": 3706990525099241821, + "key": "boolValue", + "type": "bool" + }, + { + "access": "protected", + "comment": "", + "id": 1222393410146565572, + "key": "doubleValue", + "type": "double" + }, + { + "access": "protected", + "comment": "", + "id": 3560798916678625481, + "key": "intValue", + "type": "int64" + }, + { + "access": "protected", + "comment": "", + "id": 4545092499539927335, + "key": "stringValue", + "type": "std::string" + }, + { + "access": "protected", + "comment": "", + "id": 20670761374664944, + "key": "uintValue", + "type": "uint64" + } + ], + "comment": "", + "deferring": 0, + "eventDriven": false, + "frequency": 5, + "id": 563281824642724619, + "implementationName": "", + "inheritBlackboard": false, + "libraryName": "alica-tests", + "name": "BlackboardExceptionTestBeh", + "postCondition": null, + "preCondition": null, + "runtimeCondition": null, + "variables": [] +} diff --git a/alica_tests/etc/behaviours/InheritFromParentCTestBeh.beh b/alica_tests/etc/behaviours/InheritFromParentCTestBeh.beh new file mode 100644 index 000000000..4130c625c --- /dev/null +++ b/alica_tests/etc/behaviours/InheritFromParentCTestBeh.beh @@ -0,0 +1,16 @@ +{ + "blackboard": [], + "comment": "", + "deferring": 0, + "eventDriven": false, + "frequency": 5, + "id": 3173948008495946955, + "implementationName": "", + "inheritBlackboard": true, + "libraryName": "alica-tests", + "name": "InheritFromParentCTestBeh", + "postCondition": null, + "preCondition": null, + "runtimeCondition": null, + "variables": [] +} diff --git a/alica_tests/etc/behaviours/OverwriteValueWithDifferentTypeTestBeh.beh b/alica_tests/etc/behaviours/OverwriteValueWithDifferentTypeTestBeh.beh new file mode 100644 index 000000000..69f6cc2c9 --- /dev/null +++ b/alica_tests/etc/behaviours/OverwriteValueWithDifferentTypeTestBeh.beh @@ -0,0 +1,24 @@ +{ + "blackboard": [ + { + "access": "protected", + "comment": "", + "id": 1982966351342505470, + "key": "anyValue", + "type": "std::any" + } + ], + "comment": "", + "deferring": 0, + "eventDriven": false, + "frequency": 5, + "id": 4399049787950021473, + "implementationName": "", + "inheritBlackboard": false, + "libraryName": "alica-tests", + "name": "OverwriteValueWithDifferentTypeTestBeh", + "postCondition": null, + "preCondition": null, + "runtimeCondition": null, + "variables": [] +} diff --git a/alica_tests/etc/behaviours/SetAsAnyTestBeh.beh b/alica_tests/etc/behaviours/SetAsAnyTestBeh.beh new file mode 100644 index 000000000..b8c0674ae --- /dev/null +++ b/alica_tests/etc/behaviours/SetAsAnyTestBeh.beh @@ -0,0 +1,24 @@ +{ + "blackboard": [ + { + "access": "protected", + "comment": "", + "id": 3617953517100981902, + "key": "anyValue", + "type": "std::any" + } + ], + "comment": "", + "deferring": 0, + "eventDriven": false, + "frequency": 5, + "id": 215712651194641312, + "implementationName": "", + "inheritBlackboard": false, + "libraryName": "alica-tests", + "name": "SetAsAnyTestBeh", + "postCondition": null, + "preCondition": null, + "runtimeCondition": null, + "variables": [] +} diff --git a/alica_tests/etc/behaviours/SetWithSpecifyingTypeTestBeh.beh b/alica_tests/etc/behaviours/SetWithSpecifyingTypeTestBeh.beh new file mode 100644 index 000000000..f407ab98a --- /dev/null +++ b/alica_tests/etc/behaviours/SetWithSpecifyingTypeTestBeh.beh @@ -0,0 +1,16 @@ +{ + "blackboard": [], + "comment": "", + "deferring": 0, + "eventDriven": false, + "frequency": 5, + "id": 1967012207662912929, + "implementationName": "", + "inheritBlackboard": false, + "libraryName": "alica-tests", + "name": "SetWithSpecifyingTypeTestBeh", + "postCondition": null, + "preCondition": null, + "runtimeCondition": null, + "variables": [] +} diff --git a/alica_tests/etc/plans/BlackboardAnyTestPlan.pml b/alica_tests/etc/plans/BlackboardAnyTestPlan.pml new file mode 100644 index 000000000..b5dc8a317 --- /dev/null +++ b/alica_tests/etc/plans/BlackboardAnyTestPlan.pml @@ -0,0 +1,455 @@ +{ + "blackboard": [ + { + "access": "protected", + "comment": "", + "id": 596717002024153194, + "key": "ChooseTestState2OverwriteValueWithDifferentTypeTestState", + "type": "bool" + }, + { + "access": "protected", + "comment": "", + "id": 3183790171424958342, + "key": "ChooseTestState2SetAsAnyTestState", + "type": "bool" + }, + { + "access": "protected", + "comment": "", + "id": 1468721377253480800, + "key": "ChooseTestState2AccessAsAnyTestState", + "type": "bool" + }, + { + "access": "protected", + "comment": "", + "id": 3713318294945971428, + "key": "ChooseTestState2SetWithSpecifyingTypeTestState", + "type": "bool" + } + ], + "comment": "", + "entryPoints": [ + { + "comment": "", + "id": 3051358524960609998, + "isDynamic": false, + "maxCardinality": 2147483647, + "minCardinality": 0, + "name": "", + "plan": 1578937713657933189, + "positionWeb": { + "x": 190, + "y": 231.578125 + }, + "state": 71270235805491939, + "successRequired": false, + "task": "taskrepository.tsk#1225112227903" + } + ], + "frequency": 0, + "id": 1578937713657933189, + "implementationName": "UntracedPlan", + "inheritBlackboard": false, + "libraryName": "alica_standard_library", + "masterPlan": false, + "name": "BlackboardAnyTestPlan", + "preCondition": null, + "runtimeCondition": null, + "states": [ + { + "comment": "", + "confAbstractPlanWrappers": [ + { + "abstractPlan": "OverwriteValueWithDifferentTypeTestBeh.beh#4399049787950021473", + "comment": "", + "configuration": null, + "id": 915959907932490882, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "" + } + ], + "entryPoint": null, + "id": 454026604792850007, + "inTransitions": [ + 3030470219591531308 + ], + "name": "OverwriteValueWIthDifferentTypeTestState", + "outTransitions": [ + 911501001947067876 + ], + "parentPlan": 1578937713657933189, + "positionWeb": { + "x": 702, + "y": 131.578125 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 3534693618802586510, + "inTransitions": [ + 3452290056321843317, + 911501001947067876, + 3737969493616125732, + 3923063415261756327 + ], + "name": "SuccessState", + "outTransitions": [], + "parentPlan": 1578937713657933189, + "positionWeb": { + "x": 1117, + "y": 352.578125 + }, + "postCondition": null, + "success": true, + "type": "TerminalState", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [ + { + "abstractPlan": "SetAsAnyTestBeh.beh#215712651194641312", + "comment": "", + "configuration": null, + "id": 1434558316339666457, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "" + } + ], + "entryPoint": null, + "id": 2292066748998403089, + "inTransitions": [ + 1166208708564119385 + ], + "name": "SetAsAnyTestState", + "outTransitions": [ + 3452290056321843317 + ], + "parentPlan": 1578937713657933189, + "positionWeb": { + "x": 746, + "y": 449.578125 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [ + { + "abstractPlan": "AccessAsAnyTestBeh.beh#103008403659174438", + "comment": "", + "configuration": null, + "id": 3105622622258023190, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "" + } + ], + "entryPoint": null, + "id": 4042038736016474424, + "inTransitions": [ + 3285909339681176986 + ], + "name": "AccessAsAnyTestState", + "outTransitions": [ + 3737969493616125732 + ], + "parentPlan": 1578937713657933189, + "positionWeb": { + "x": 764.8566433566433, + "y": 745.9460773601397 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [ + { + "abstractPlan": "SetWithSpecifyingTypeTestBeh.beh#1967012207662912929", + "comment": "", + "configuration": null, + "id": 1232792656047449218, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "" + } + ], + "entryPoint": null, + "id": 2489491116942426158, + "inTransitions": [ + 3920671252638360136 + ], + "name": "SetWithSpecifyingTypeTestState", + "outTransitions": [ + 3923063415261756327 + ], + "parentPlan": 1578937713657933189, + "positionWeb": { + "x": 751.865034965035, + "y": 608.6062172202796 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": 3051358524960609998, + "id": 71270235805491939, + "inTransitions": [], + "name": "ChooseTestState", + "outTransitions": [ + 1166208708564119385, + 3920671252638360136, + 3030470219591531308, + 3285909339681176986 + ], + "parentPlan": 1578937713657933189, + "positionWeb": { + "x": 440, + "y": 247.578125 + }, + "type": "State", + "variableBindings": [] + } + ], + "synchronisations": [], + "transitions": [ + { + "comment": "", + "condition": "ConditionRepository.cnd#1", + "id": 3452290056321843317, + "inState": 2292066748998403089, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "", + "outState": 3534693618802586510, + "pointsWeb": [], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 2279792593028974864, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#1", + "id": 911501001947067876, + "inState": 454026604792850007, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "", + "outState": 3534693618802586510, + "pointsWeb": [], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 4444247153084361728, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#3592699233854318376", + "id": 1166208708564119385, + "inState": 71270235805491939, + "keyMapping": { + "input": [ + { + "childKey": "result", + "parentKey": "ChooseTestState2SetAsAnyTestState", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 2292066748998403089, + "pointsWeb": [], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 1223241439336082757, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#3592699233854318376", + "id": 3920671252638360136, + "inState": 71270235805491939, + "keyMapping": { + "input": [ + { + "childKey": "result", + "parentKey": "ChooseTestState2SetWithSpecifyingTypeTestState", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 2489491116942426158, + "pointsWeb": [], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 73382690912632924, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#1", + "id": 3737969493616125732, + "inState": 4042038736016474424, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "", + "outState": 3534693618802586510, + "pointsWeb": [], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 1853996312728269919, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#1", + "id": 3923063415261756327, + "inState": 2489491116942426158, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "", + "outState": 3534693618802586510, + "pointsWeb": [], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 3053136108186850743, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#3592699233854318376", + "id": 3030470219591531308, + "inState": 71270235805491939, + "keyMapping": { + "input": [ + { + "childKey": "result", + "parentKey": "ChooseTestState2OverwriteValueWithDifferentTypeTestState", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 454026604792850007, + "pointsWeb": [], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 3777408508957011885, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#3592699233854318376", + "id": 3285909339681176986, + "inState": 71270235805491939, + "keyMapping": { + "input": [ + { + "childKey": "result", + "parentKey": "ChooseTestState2AccessAsAnyTestState", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 4042038736016474424, + "pointsWeb": [], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 572259393514094327, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + } + ], + "utilityThreshold": 0.0, + "variables": [] +} diff --git a/alica_tests/etc/plans/BlackboardExceptionTestPlan.pml b/alica_tests/etc/plans/BlackboardExceptionTestPlan.pml new file mode 100644 index 000000000..108da3954 --- /dev/null +++ b/alica_tests/etc/plans/BlackboardExceptionTestPlan.pml @@ -0,0 +1,53 @@ +{ + "blackboard": [], + "comment": "", + "entryPoints": [ + { + "comment": "", + "id": 2049747884282970053, + "isDynamic": false, + "maxCardinality": 2147483647, + "minCardinality": 0, + "name": "", + "plan": 3143578758617978921, + "positionWeb": { + "x": 222, + "y": 274.578125 + }, + "state": 3459389825307803607, + "successRequired": false, + "task": "taskrepository.tsk#1225112227903" + } + ], + "frequency": 0, + "id": 3143578758617978921, + "implementationName": "", + "inheritBlackboard": false, + "libraryName": "alica-tests", + "masterPlan": false, + "name": "BlackboardExceptionTestPlan", + "preCondition": null, + "runtimeCondition": null, + "states": [ + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": 2049747884282970053, + "id": 3459389825307803607, + "inTransitions": [], + "name": "", + "outTransitions": [], + "parentPlan": 3143578758617978921, + "positionWeb": { + "x": 421, + "y": 288.578125 + }, + "type": "State", + "variableBindings": [] + } + ], + "synchronisations": [], + "transitions": [], + "utilityThreshold": 0.0, + "variables": [] +} diff --git a/alica_tests/etc/plans/BlackboardTestPlan.pml b/alica_tests/etc/plans/BlackboardTestPlan.pml index 0707a77e2..311078243 100644 --- a/alica_tests/etc/plans/BlackboardTestPlan.pml +++ b/alica_tests/etc/plans/BlackboardTestPlan.pml @@ -27,6 +27,34 @@ "id": 3928341634460937152, "key": "ChooseBlackboardTestState2PopulateBlackboardTestState", "type": "bool" + }, + { + "access": "protected", + "comment": "", + "id": 4605463773961363941, + "key": "ChooseBlackboardTestState2MappingFromTestState", + "type": "bool" + }, + { + "access": "protected", + "comment": "", + "id": 3574364347909149459, + "key": "ChooseBlackboardTestState2InheritFromParentTestState", + "type": "bool" + }, + { + "access": "protected", + "comment": "", + "id": 2623139515870155114, + "key": "ChooseBlackboardTestState2BlackboardExceptionTestState", + "type": "bool" + }, + { + "access": "protected", + "comment": "", + "id": 2728662829030021930, + "key": "ChooseBlackboardTestState2BlackboardAnyTestState", + "type": "bool" } ], "comment": "", @@ -127,7 +155,10 @@ 1591792576101512594, 2025444659250378559, 2898451417708501510, - 3982256618930995182 + 3982256618930995182, + 111722555649933745, + 4058344073033619191, + 3370611371440099521 ], "parentPlan": 1633245244310547016, "positionWeb": { @@ -242,7 +273,10 @@ 171823477339840252, 543853498590134994, 2617458369167221176, - 3610708172177662828 + 3610708172177662828, + 100553280754676548, + 3470973237238019675, + 2293502069296453618 ], "name": "SuccessState", "outTransitions": [], @@ -275,6 +309,128 @@ }, "type": "State", "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [ + { + "abstractPlan": "BlackboardExceptionTestBeh.beh#563281824642724619", + "comment": "", + "configuration": null, + "id": 1476937640286666693, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "" + } + ], + "entryPoint": null, + "id": 1789315807376094758, + "inTransitions": [ + 3370611371440099521 + ], + "name": "BlackboardExceptionTestState", + "outTransitions": [ + 3470973237238019675 + ], + "parentPlan": 1633245244310547016, + "positionWeb": { + "x": 725.8287449416673, + "y": 1200.6875812871745 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [ + { + "abstractPlan": "BlackboardAnyTestPlan.pml#1578937713657933189", + "comment": "", + "configuration": null, + "id": 2471691759138797437, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "" + } + ], + "entryPoint": null, + "id": 2615437904727714940, + "inTransitions": [ + 4058344073033619191 + ], + "name": "BlackboardAnyTestState", + "outTransitions": [ + 2293502069296453618 + ], + "parentPlan": 1633245244310547016, + "positionWeb": { + "x": 762.9870886342195, + "y": 1409.6442759846486 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [ + { + "abstractPlan": "InheritFromParentTestPlan.pml#2157089947574819410", + "comment": "", + "configuration": null, + "id": 1441035851201364708, + "keyMapping": { + "input": [ + { + "childKey": "boolValueA", + "parentKey": null, + "value": false + }, + { + "childKey": "doubleValueA", + "parentKey": null, + "value": 1.0 + }, + { + "childKey": "intValueA", + "parentKey": null, + "value": 1 + }, + { + "childKey": "stringValueA", + "parentKey": null, + "value": "initString" + }, + { + "childKey": "uintValueA", + "parentKey": null, + "value": 1 + } + ], + "output": [] + }, + "name": "" + } + ], + "entryPoint": null, + "id": 1838328320763180289, + "inTransitions": [ + 111722555649933745 + ], + "name": "InheritFromParentTestState", + "outTransitions": [ + 100553280754676548 + ], + "parentPlan": 1633245244310547016, + "positionWeb": { + "x": 714.1216991963261, + "y": 1006.4042766934558 + }, + "type": "State", + "variableBindings": [] } ], "synchronisations": [], @@ -560,6 +716,188 @@ "variables": [] }, "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#1", + "id": 100553280754676548, + "inState": 1838328320763180289, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "", + "outState": 3953151813073280186, + "pointsWeb": [], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 2314195684838070629, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#3592699233854318376", + "id": 111722555649933745, + "inState": 950259230717695500, + "keyMapping": { + "input": [ + { + "childKey": "result", + "parentKey": "ChooseBlackboardTestState2InheritFromParentTestState", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 1838328320763180289, + "pointsWeb": [ + { + "x": 468.4270952927669, + "y": 944.4065729047072 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 4091662183874567066, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#1", + "id": 3470973237238019675, + "inState": 1789315807376094758, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "", + "outState": 3953151813073280186, + "pointsWeb": [], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 376607052513038464, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#3592699233854318376", + "id": 4058344073033619191, + "inState": 950259230717695500, + "keyMapping": { + "input": [ + { + "childKey": "result", + "parentKey": "ChooseBlackboardTestState2BlackboardAnyTestState", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 2615437904727714940, + "pointsWeb": [ + { + "x": 354.84764186491844, + "y": 1213.6725574962143 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 1634134180605004094, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#1", + "id": 2293502069296453618, + "inState": 2615437904727714940, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "", + "outState": 3953151813073280186, + "pointsWeb": [ + { + "x": 1082.0484815451414, + "y": 1305.98981331308 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 4141968262457814305, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#3592699233854318376", + "id": 3370611371440099521, + "inState": 950259230717695500, + "keyMapping": { + "input": [ + { + "childKey": "result", + "parentKey": "ChooseBlackboardTestState2BlackboardExceptionTestState", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 1789315807376094758, + "pointsWeb": [ + { + "x": 419.73276569393704, + "y": 1050.2336253857477 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 2856057307762913052, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null } ], "utilityThreshold": 0.0, diff --git a/alica_tests/etc/plans/InheritFromParentATestPlan.pml b/alica_tests/etc/plans/InheritFromParentATestPlan.pml new file mode 100644 index 000000000..a01cb6e38 --- /dev/null +++ b/alica_tests/etc/plans/InheritFromParentATestPlan.pml @@ -0,0 +1,527 @@ +{ + "blackboard": [], + "comment": "", + "entryPoints": [ + { + "comment": "", + "id": 557658953352140847, + "isDynamic": false, + "maxCardinality": 2147483647, + "minCardinality": 0, + "name": "", + "plan": 185950610054102790, + "positionWeb": { + "x": 200, + "y": 212 + }, + "state": 1981213401458939423, + "successRequired": false, + "task": "taskrepository.tsk#1225112227903" + } + ], + "frequency": 0, + "id": 185950610054102790, + "implementationName": "", + "inheritBlackboard": true, + "libraryName": "alica-tests", + "masterPlan": false, + "name": "InheritFromParentATestPlan", + "preCondition": null, + "runtimeCondition": null, + "states": [ + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 2588330984497349278, + "inTransitions": [ + 2268952358136177381 + ], + "name": "SuccessState", + "outTransitions": [], + "parentPlan": 185950610054102790, + "positionWeb": { + "x": 2492, + "y": 200 + }, + "postCondition": null, + "success": true, + "type": "TerminalState", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 3807068659782313209, + "inTransitions": [ + 155545721980803188 + ], + "name": "BoolCheckState", + "outTransitions": [ + 3674805364839002711 + ], + "parentPlan": 185950610054102790, + "positionWeb": { + "x": 686, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": 557658953352140847, + "id": 1981213401458939423, + "inTransitions": [], + "name": "WaitForChildCheckState", + "outTransitions": [ + 155545721980803188 + ], + "parentPlan": 185950610054102790, + "positionWeb": { + "x": 428, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [ + { + "abstractPlan": "NotInheritFromParentBTestPlan.pml#2263642900900487682", + "comment": "", + "configuration": null, + "id": 1655089164413261303, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "" + } + ], + "entryPoint": null, + "id": 1912512209747628177, + "inTransitions": [ + 2453373586649227929 + ], + "name": "RunChildState", + "outTransitions": [ + 2268952358136177381 + ], + "parentPlan": 185950610054102790, + "positionWeb": { + "x": 2234, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 1473752614955870368, + "inTransitions": [ + 3674805364839002711 + ], + "name": "DoubleCheckState", + "outTransitions": [ + 3538171417827374918 + ], + "parentPlan": 185950610054102790, + "positionWeb": { + "x": 944, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 737679182618201925, + "inTransitions": [ + 2738668016169155258 + ], + "name": "StringCheckState", + "outTransitions": [ + 2136399575035608972 + ], + "parentPlan": 185950610054102790, + "positionWeb": { + "x": 1460, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 1841589429979206762, + "inTransitions": [ + 2136399575035608972 + ], + "name": "UIntCheckState", + "outTransitions": [ + 274702503629366242 + ], + "parentPlan": 185950610054102790, + "positionWeb": { + "x": 1718, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 3723520305164992257, + "inTransitions": [ + 274702503629366242 + ], + "name": "WaitState", + "outTransitions": [ + 2453373586649227929 + ], + "parentPlan": 185950610054102790, + "positionWeb": { + "x": 1976, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 534005728445547023, + "inTransitions": [ + 3538171417827374918 + ], + "name": "IntCheckState", + "outTransitions": [ + 2738668016169155258 + ], + "parentPlan": 185950610054102790, + "positionWeb": { + "x": 1202, + "y": 200 + }, + "type": "State", + "variableBindings": [] + } + ], + "synchronisations": [], + "transitions": [ + { + "comment": "", + "condition": "ConditionRepository.cnd#1", + "id": 2268952358136177381, + "inState": 1912512209747628177, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "", + "outState": 2588330984497349278, + "pointsWeb": [ + { + "x": 2392, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 2699829842384471487, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#3592699233854318376", + "id": 2453373586649227929, + "inState": 3723520305164992257, + "keyMapping": { + "input": [ + { + "childKey": "result", + "parentKey": "WaitState2RunChildState", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 1912512209747628177, + "pointsWeb": [ + { + "x": 2134, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 1656597672713449931, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#89453017592951088", + "id": 3674805364839002711, + "inState": 3807068659782313209, + "keyMapping": { + "input": [ + { + "childKey": "left", + "parentKey": "boolValueA", + "value": null + }, + { + "childKey": "right", + "parentKey": null, + "value": false + } + ], + "output": [] + }, + "name": "", + "outState": 1473752614955870368, + "pointsWeb": [ + { + "x": 844, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 2832667233547521716, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#3592699233854318376", + "id": 155545721980803188, + "inState": 1981213401458939423, + "keyMapping": { + "input": [ + { + "childKey": "result", + "parentKey": "WaitForChildCheckState2BoolCheckState", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 3807068659782313209, + "pointsWeb": [ + { + "x": 586, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 1737979141296925600, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#4434919629521912839", + "id": 2136399575035608972, + "inState": 737679182618201925, + "keyMapping": { + "input": [ + { + "childKey": "right", + "parentKey": "stringValueA", + "value": null + }, + { + "childKey": "left", + "parentKey": null, + "value": "initString" + } + ], + "output": [] + }, + "name": "", + "outState": 1841589429979206762, + "pointsWeb": [ + { + "x": 1618, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 2314934188662122139, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#2618711924921632178", + "id": 2738668016169155258, + "inState": 534005728445547023, + "keyMapping": { + "input": [ + { + "childKey": "right", + "parentKey": "intValueA", + "value": null + }, + { + "childKey": "left", + "parentKey": null, + "value": 1 + } + ], + "output": [] + }, + "name": "", + "outState": 737679182618201925, + "pointsWeb": [ + { + "x": 1360, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 2194138094258125255, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#344595839150634454", + "id": 274702503629366242, + "inState": 1841589429979206762, + "keyMapping": { + "input": [ + { + "childKey": "left", + "parentKey": null, + "value": 1 + }, + { + "childKey": "right", + "parentKey": "uintValueA", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 3723520305164992257, + "pointsWeb": [ + { + "x": 1876, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 2786379039662157679, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#1644313031322732060", + "id": 3538171417827374918, + "inState": 1473752614955870368, + "keyMapping": { + "input": [ + { + "childKey": "right", + "parentKey": "doubleValueA", + "value": null + }, + { + "childKey": "left", + "parentKey": null, + "value": 1.0 + } + ], + "output": [] + }, + "name": "", + "outState": 534005728445547023, + "pointsWeb": [ + { + "x": 1102, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 3793500998732088231, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + } + ], + "utilityThreshold": 0.0, + "variables": [] +} diff --git a/alica_tests/etc/plans/InheritFromParentTestPlan.pml b/alica_tests/etc/plans/InheritFromParentTestPlan.pml new file mode 100644 index 000000000..fd411d655 --- /dev/null +++ b/alica_tests/etc/plans/InheritFromParentTestPlan.pml @@ -0,0 +1,591 @@ +{ + "blackboard": [ + { + "access": "input", + "comment": "", + "id": 776883745699711074, + "key": "boolValueA", + "type": "bool" + }, + { + "access": "input", + "comment": "", + "id": 1045429957834828049, + "key": "doubleValueA", + "type": "double" + }, + { + "access": "input", + "comment": "", + "id": 2663555862223669320, + "key": "intValueA", + "type": "int64" + }, + { + "access": "protected", + "comment": "", + "id": 3960079466910667887, + "key": "WaitForStartState2RunChildState", + "type": "bool" + }, + { + "access": "input", + "comment": "", + "id": 3117720767320173565, + "key": "stringValueA", + "type": "std::string" + }, + { + "access": "protected", + "comment": "", + "id": 2055483658164079019, + "key": "WaitForChildCheckState2BoolCheckState", + "type": "bool" + }, + { + "access": "protected", + "comment": "", + "id": 1298429764553491757, + "key": "WaitState2RunChildState", + "type": "bool" + }, + { + "access": "input", + "comment": "", + "id": 2746243078063830243, + "key": "uintValueA", + "type": "uint64" + }, + { + "access": "protected", + "comment": "", + "id": 4039015193095208070, + "key": "WaitForCheckState2CheckBoolState", + "type": "bool" + } + ], + "comment": "", + "entryPoints": [ + { + "comment": "", + "id": 31391243837222744, + "isDynamic": false, + "maxCardinality": 2147483647, + "minCardinality": 0, + "name": "", + "plan": 2157089947574819410, + "positionWeb": { + "x": 200, + "y": 212 + }, + "state": 88509593835280074, + "successRequired": false, + "task": "taskrepository.tsk#1225112227903" + } + ], + "frequency": 0, + "id": 2157089947574819410, + "implementationName": "UntracedPlan", + "inheritBlackboard": false, + "libraryName": "alica_standard_library", + "masterPlan": false, + "name": "InheritFromParentTestPlan", + "preCondition": null, + "runtimeCondition": null, + "states": [ + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 63072614606188547, + "inTransitions": [ + 1583385661528817487 + ], + "name": "CheckStringState", + "outTransitions": [ + 667522708593373227 + ], + "parentPlan": 2157089947574819410, + "positionWeb": { + "x": 1976, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 4205561319963440289, + "inTransitions": [ + 3007832720972401983 + ], + "name": "WaitForCheckState", + "outTransitions": [ + 3141747145452095082 + ], + "parentPlan": 2157089947574819410, + "positionWeb": { + "x": 944, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": 31391243837222744, + "id": 88509593835280074, + "inTransitions": [], + "name": "WaitForStartState", + "outTransitions": [ + 1402131350580369528 + ], + "parentPlan": 2157089947574819410, + "positionWeb": { + "x": 428, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 2595473976789985278, + "inTransitions": [ + 1032498883150016692 + ], + "name": "CheckIntState", + "outTransitions": [ + 1583385661528817487 + ], + "parentPlan": 2157089947574819410, + "positionWeb": { + "x": 1718, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 2255632851020707596, + "inTransitions": [ + 3861936007093432974 + ], + "name": "CheckDoubleState", + "outTransitions": [ + 1032498883150016692 + ], + "parentPlan": 2157089947574819410, + "positionWeb": { + "x": 1460, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 4527972571656844729, + "inTransitions": [ + 3141747145452095082 + ], + "name": "CheckBoolState", + "outTransitions": [ + 3861936007093432974 + ], + "parentPlan": 2157089947574819410, + "positionWeb": { + "x": 1202, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 3866456247835935725, + "inTransitions": [ + 667522708593373227 + ], + "name": "CheckUIntState", + "outTransitions": [ + 3032574709008121663 + ], + "parentPlan": 2157089947574819410, + "positionWeb": { + "x": 2234, + "y": 200 + }, + "type": "State", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 3596014439409661935, + "inTransitions": [ + 3032574709008121663 + ], + "name": "SuccessState", + "outTransitions": [], + "parentPlan": 2157089947574819410, + "positionWeb": { + "x": 2492, + "y": 200 + }, + "postCondition": null, + "success": true, + "type": "TerminalState", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [ + { + "abstractPlan": "InheritFromParentATestPlan.pml#185950610054102790", + "comment": "", + "configuration": null, + "id": 963463330093943381, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "" + } + ], + "entryPoint": null, + "id": 750727936829194403, + "inTransitions": [ + 1402131350580369528 + ], + "name": "RunChildState", + "outTransitions": [ + 3007832720972401983 + ], + "parentPlan": 2157089947574819410, + "positionWeb": { + "x": 686, + "y": 200 + }, + "type": "State", + "variableBindings": [] + } + ], + "synchronisations": [], + "transitions": [ + { + "comment": "", + "condition": "ConditionRepository.cnd#4434919629521912839", + "id": 667522708593373227, + "inState": 63072614606188547, + "keyMapping": { + "input": [ + { + "childKey": "right", + "parentKey": "stringValueA", + "value": null + }, + { + "childKey": "left", + "parentKey": null, + "value": "setString" + } + ], + "output": [] + }, + "name": "", + "outState": 3866456247835935725, + "pointsWeb": [ + { + "x": 2134, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 2197652967974413170, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#1", + "id": 3007832720972401983, + "inState": 750727936829194403, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "", + "outState": 4205561319963440289, + "pointsWeb": [ + { + "x": 844, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 2668066786575517906, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#89453017592951088", + "id": 3861936007093432974, + "inState": 4527972571656844729, + "keyMapping": { + "input": [ + { + "childKey": "right", + "parentKey": null, + "value": true + }, + { + "childKey": "left", + "parentKey": "boolValueA", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 2255632851020707596, + "pointsWeb": [ + { + "x": 1360, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 2072312308530029012, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#1644313031322732060", + "id": 1032498883150016692, + "inState": 2255632851020707596, + "keyMapping": { + "input": [ + { + "childKey": "right", + "parentKey": "doubleValueA", + "value": null + }, + { + "childKey": "left", + "parentKey": null, + "value": 2.0 + } + ], + "output": [] + }, + "name": "", + "outState": 2595473976789985278, + "pointsWeb": [ + { + "x": 1618, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 4142442813779815446, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#344595839150634454", + "id": 3032574709008121663, + "inState": 3866456247835935725, + "keyMapping": { + "input": [ + { + "childKey": "right", + "parentKey": "uintValueA", + "value": null + }, + { + "childKey": "left", + "parentKey": null, + "value": 2 + } + ], + "output": [] + }, + "name": "", + "outState": 3596014439409661935, + "pointsWeb": [ + { + "x": 2392, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 392334397707378843, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#3592699233854318376", + "id": 3141747145452095082, + "inState": 4205561319963440289, + "keyMapping": { + "input": [ + { + "childKey": "result", + "parentKey": "WaitForCheckState2CheckBoolState", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 4527972571656844729, + "pointsWeb": [ + { + "x": 1102, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 4547913147153968184, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#2618711924921632178", + "id": 1583385661528817487, + "inState": 2595473976789985278, + "keyMapping": { + "input": [ + { + "childKey": "right", + "parentKey": "intValueA", + "value": null + }, + { + "childKey": "left", + "parentKey": null, + "value": 2 + } + ], + "output": [] + }, + "name": "", + "outState": 63072614606188547, + "pointsWeb": [ + { + "x": 1876, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 272091851166634952, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, + { + "comment": "", + "condition": "ConditionRepository.cnd#3592699233854318376", + "id": 1402131350580369528, + "inState": 88509593835280074, + "keyMapping": { + "input": [ + { + "childKey": "result", + "parentKey": "WaitForStartState2RunChildState", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 750727936829194403, + "pointsWeb": [ + { + "x": 586, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 1513225630979125110, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + } + ], + "utilityThreshold": 0.0, + "variables": [] +} diff --git a/alica_tests/etc/plans/NotInheritFromParentBTestPlan.pml b/alica_tests/etc/plans/NotInheritFromParentBTestPlan.pml new file mode 100644 index 000000000..2b8b28f69 --- /dev/null +++ b/alica_tests/etc/plans/NotInheritFromParentBTestPlan.pml @@ -0,0 +1,153 @@ +{ + "blackboard": [ + { + "access": "protected", + "comment": "", + "id": 53123210794255978, + "key": "uintValueB", + "type": "uint64" + }, + { + "access": "protected", + "comment": "", + "id": 4255008038418301369, + "key": "doubleValueB", + "type": "double" + }, + { + "access": "protected", + "comment": "", + "id": 3680374252032854739, + "key": "boolValueB", + "type": "bool" + }, + { + "access": "protected", + "comment": "", + "id": 3511659697694726328, + "key": "intValueB", + "type": "int64" + }, + { + "access": "protected", + "comment": "", + "id": 4277380365509580990, + "key": "stringValueB", + "type": "std::string" + } + ], + "comment": "", + "entryPoints": [ + { + "comment": "", + "id": 2306507221779934961, + "isDynamic": false, + "maxCardinality": 2147483647, + "minCardinality": 0, + "name": "", + "plan": 2263642900900487682, + "positionWeb": { + "x": 200, + "y": 212 + }, + "state": 2584628389580830143, + "successRequired": false, + "task": "taskrepository.tsk#1225112227903" + } + ], + "frequency": 0, + "id": 2263642900900487682, + "implementationName": "", + "inheritBlackboard": false, + "libraryName": "alica-tests", + "masterPlan": false, + "name": "NotInheritFromParentBTestPlan", + "preCondition": null, + "runtimeCondition": null, + "states": [ + { + "comment": "", + "confAbstractPlanWrappers": [], + "entryPoint": null, + "id": 3471316341325581983, + "inTransitions": [ + 1859738224035874603 + ], + "name": "SuccessState", + "outTransitions": [], + "parentPlan": 2263642900900487682, + "positionWeb": { + "x": 686, + "y": 200 + }, + "postCondition": null, + "success": true, + "type": "TerminalState", + "variableBindings": [] + }, + { + "comment": "", + "confAbstractPlanWrappers": [ + { + "abstractPlan": "InheritFromParentCTestBeh.beh#3173948008495946955", + "comment": "", + "configuration": null, + "id": 2012965625476563017, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "" + } + ], + "entryPoint": 2306507221779934961, + "id": 2584628389580830143, + "inTransitions": [], + "name": "CheckNotInheritFromParentState", + "outTransitions": [ + 1859738224035874603 + ], + "parentPlan": 2263642900900487682, + "positionWeb": { + "x": 428, + "y": 200 + }, + "type": "State", + "variableBindings": [] + } + ], + "synchronisations": [], + "transitions": [ + { + "comment": "", + "condition": "ConditionRepository.cnd#1", + "id": 1859738224035874603, + "inState": 2584628389580830143, + "keyMapping": { + "input": [], + "output": [] + }, + "name": "", + "outState": 3471316341325581983, + "pointsWeb": [ + { + "x": 586, + "y": 229 + } + ], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 1692165902337928048, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + } + ], + "utilityThreshold": 0.0, + "variables": [] +} diff --git a/alica_tests/etc/plans/SchedulingTestPlan.pml b/alica_tests/etc/plans/SchedulingTestPlan.pml index d9ff44f7b..57a8c0bd5 100644 --- a/alica_tests/etc/plans/SchedulingTestPlan.pml +++ b/alica_tests/etc/plans/SchedulingTestPlan.pml @@ -17,15 +17,15 @@ { "access": "protected", "comment": "", - "id": 3103901468860392175, - "key": "ChooseTestState2SchedulingPlanTestState", + "id": 1375412086750652826, + "key": "ChooseTestState2ExecOrderTestState", "type": "bool" }, { "access": "protected", "comment": "", - "id": 1375412086750652826, - "key": "ChooseTestState2ExecOrderTestState", + "id": 3103901468860392175, + "key": "ChooseTestState2SchedulingPlanTestState", "type": "bool" } ], @@ -154,9 +154,9 @@ "name": "ChooseTestState", "outTransitions": [ 981095176145378775, + 1821712422949873757, 1846034327219291762, - 4587239275124055604, - 1821712422949873757 + 4587239275124055604 ], "parentPlan": 500355457826444680, "positionWeb": { @@ -334,6 +334,36 @@ }, "synchronisation": null }, + { + "comment": "", + "condition": "ConditionRepository.cnd#3592699233854318376", + "id": 1821712422949873757, + "inState": 3057463781729421980, + "keyMapping": { + "input": [ + { + "childKey": "result", + "parentKey": "ChooseTestState2ExecOrderTestState", + "value": null + } + ], + "output": [] + }, + "name": "", + "outState": 3067509435331022119, + "pointsWeb": [], + "preCondition": { + "comment": "", + "conditionString": "", + "enabled": true, + "id": 3398814735947491827, + "name": "", + "pluginName": "DefaultPlugin", + "quantifiers": [], + "variables": [] + }, + "synchronisation": null + }, { "comment": "", "condition": "ConditionRepository.cnd#3592699233854318376", @@ -472,36 +502,6 @@ "variables": [] }, "synchronisation": null - }, - { - "comment": "", - "condition": "ConditionRepository.cnd#3592699233854318376", - "id": 1821712422949873757, - "inState": 3057463781729421980, - "keyMapping": { - "input": [ - { - "childKey": "result", - "parentKey": "ChooseTestState2ExecOrderTestState", - "value": null - } - ], - "output": [] - }, - "name": "", - "outState": 3067509435331022119, - "pointsWeb": [], - "preCondition": { - "comment": "", - "conditionString": "", - "enabled": true, - "id": 3398814735947491827, - "name": "", - "pluginName": "DefaultPlugin", - "quantifiers": [], - "variables": [] - }, - "synchronisation": null } ], "utilityThreshold": 0.0, diff --git a/alica_tests/include/alica_tests/behaviours/AccessAsAnyTestBeh.h b/alica_tests/include/alica_tests/behaviours/AccessAsAnyTestBeh.h new file mode 100644 index 000000000..7f1a386a9 --- /dev/null +++ b/alica_tests/include/alica_tests/behaviours/AccessAsAnyTestBeh.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include + +namespace alica +{ + +class AccessAsAnyTestBeh : public BasicBehaviour +{ +public: + AccessAsAnyTestBeh(BehaviourContext& context); + static std::unique_ptr create(alica::BehaviourContext& context); + +protected: + virtual void initialiseParameters(); +}; +BOOST_DLL_ALIAS(alica::AccessAsAnyTestBeh::create, AccessAsAnyTestBeh) +} /* namespace alica */ diff --git a/alica_tests/include/alica_tests/behaviours/BlackboardExceptionTestBeh.h b/alica_tests/include/alica_tests/behaviours/BlackboardExceptionTestBeh.h new file mode 100644 index 000000000..45878c9e4 --- /dev/null +++ b/alica_tests/include/alica_tests/behaviours/BlackboardExceptionTestBeh.h @@ -0,0 +1,28 @@ +#pragma once + +#include +#include + +namespace alica +{ +// used for accessing bb values with an unknown type +class UnknownType +{ +public: + UnknownType() = default; + UnknownType(int64_t input) + : value(input){}; + int64_t value; +}; + +class BlackboardExceptionTestBeh : public BasicBehaviour +{ +public: + BlackboardExceptionTestBeh(BehaviourContext& context); + static std::unique_ptr create(alica::BehaviourContext& context); + +protected: + virtual void initialiseParameters(); +}; +BOOST_DLL_ALIAS(alica::BlackboardExceptionTestBeh::create, BlackboardExceptionTestBeh) +} /* namespace alica */ diff --git a/alica_tests/include/alica_tests/behaviours/InheritFromParentCTestBeh.h b/alica_tests/include/alica_tests/behaviours/InheritFromParentCTestBeh.h new file mode 100644 index 000000000..409a122be --- /dev/null +++ b/alica_tests/include/alica_tests/behaviours/InheritFromParentCTestBeh.h @@ -0,0 +1,18 @@ +#pragma once + +#include +#include + +namespace alica +{ +class InheritFromParentCTestBeh : public BasicBehaviour +{ +public: + InheritFromParentCTestBeh(BehaviourContext& context); + static std::unique_ptr create(alica::BehaviourContext& context); + +protected: + virtual void initialiseParameters(); +}; +BOOST_DLL_ALIAS(alica::InheritFromParentCTestBeh::create, InheritFromParentCTestBeh) +} /* namespace alica */ diff --git a/alica_tests/include/alica_tests/behaviours/OverwriteValueWithDifferentTypeTestBeh.h b/alica_tests/include/alica_tests/behaviours/OverwriteValueWithDifferentTypeTestBeh.h new file mode 100644 index 000000000..d237f4a91 --- /dev/null +++ b/alica_tests/include/alica_tests/behaviours/OverwriteValueWithDifferentTypeTestBeh.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include +#include + +namespace alica +{ +// // used for accessing bb values with an unknown type +// class UnknownType +// { +// public: +// UnknownType() = default; +// UnknownType(int64_t input) +// : value(input){}; +// int64_t value; +// }; + +class OverwriteValueWithDifferentTypeTestBeh : public BasicBehaviour +{ +public: + OverwriteValueWithDifferentTypeTestBeh(BehaviourContext& context); + static std::unique_ptr create(alica::BehaviourContext& context); + +protected: + virtual void initialiseParameters(); +}; +BOOST_DLL_ALIAS(alica::OverwriteValueWithDifferentTypeTestBeh::create, OverwriteValueWithDifferentTypeTestBeh) +} /* namespace alica */ diff --git a/alica_tests/include/alica_tests/behaviours/SetAsAnyTestBeh.h b/alica_tests/include/alica_tests/behaviours/SetAsAnyTestBeh.h new file mode 100644 index 000000000..d52ec7a1e --- /dev/null +++ b/alica_tests/include/alica_tests/behaviours/SetAsAnyTestBeh.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include + +namespace alica +{ + +class SetAsAnyTestBeh : public BasicBehaviour +{ +public: + SetAsAnyTestBeh(BehaviourContext& context); + static std::unique_ptr create(alica::BehaviourContext& context); + +protected: + virtual void initialiseParameters(); +}; +BOOST_DLL_ALIAS(alica::SetAsAnyTestBeh::create, SetAsAnyTestBeh) +} /* namespace alica */ diff --git a/alica_tests/include/alica_tests/behaviours/SetWithSpecifyingTypeTestBeh.h b/alica_tests/include/alica_tests/behaviours/SetWithSpecifyingTypeTestBeh.h new file mode 100644 index 000000000..95472dc6f --- /dev/null +++ b/alica_tests/include/alica_tests/behaviours/SetWithSpecifyingTypeTestBeh.h @@ -0,0 +1,19 @@ +#pragma once + +#include +#include + +namespace alica +{ + +class SetWithSpecifyingTypeTestBeh : public BasicBehaviour +{ +public: + SetWithSpecifyingTypeTestBeh(BehaviourContext& context); + static std::unique_ptr create(alica::BehaviourContext& context); + +protected: + virtual void initialiseParameters(); +}; +BOOST_DLL_ALIAS(alica::SetWithSpecifyingTypeTestBeh::create, SetWithSpecifyingTypeTestBeh) +} /* namespace alica */ diff --git a/alica_tests/include/alica_tests/plans/InheritFromParentATestPlan.h b/alica_tests/include/alica_tests/plans/InheritFromParentATestPlan.h new file mode 100644 index 000000000..b874c3451 --- /dev/null +++ b/alica_tests/include/alica_tests/plans/InheritFromParentATestPlan.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include +#include +#include +#include + +namespace alica +{ +class InheritFromParentATestPlan : public AlicaTestsPlan +{ +public: + InheritFromParentATestPlan(PlanContext& context); + +protected: + virtual void onTerminate() override; +}; + +BOOST_DLL_ALIAS(alica::InheritFromParentATestPlan::create, InheritFromParentATestPlan) +BOOST_DLL_ALIAS(alica::BasicUtilityFunction::create, InheritFromParentATestPlanUtilityFunction) +} /* namespace alica */ diff --git a/alica_tests/include/alica_tests/plans/NotInheritFromParentBTestPlan.h b/alica_tests/include/alica_tests/plans/NotInheritFromParentBTestPlan.h new file mode 100644 index 000000000..e37702b6b --- /dev/null +++ b/alica_tests/include/alica_tests/plans/NotInheritFromParentBTestPlan.h @@ -0,0 +1,22 @@ +#pragma once + +#include +#include +#include +#include +#include + +namespace alica +{ +class NotInheritFromParentBTestPlan : public AlicaTestsPlan +{ +public: + NotInheritFromParentBTestPlan(PlanContext& context); + +protected: + virtual void onInit() override; +}; + +BOOST_DLL_ALIAS(alica::NotInheritFromParentBTestPlan::create, NotInheritFromParentBTestPlan) +BOOST_DLL_ALIAS(alica::BasicUtilityFunction::create, NotInheritFromParentBTestPlanUtilityFunction) +} /* namespace alica */ diff --git a/alica_tests/src/behaviours/AccessAsAnyTestBeh.cpp b/alica_tests/src/behaviours/AccessAsAnyTestBeh.cpp new file mode 100644 index 000000000..4f792fc87 --- /dev/null +++ b/alica_tests/src/behaviours/AccessAsAnyTestBeh.cpp @@ -0,0 +1,33 @@ +#include +#include +#include +#include + +namespace alica +{ + +AccessAsAnyTestBeh::AccessAsAnyTestBeh(BehaviourContext& context) + : BasicBehaviour(context) +{ +} + +void AccessAsAnyTestBeh::initialiseParameters() +{ + LockedBlackboardRW bb(*getBlackboard()); + bb.set("anyValue", PlanStatus::Success); + std::any anyValue = bb.get("anyValue"); + PlanStatus status = std::any_cast(anyValue); + + if (status != PlanStatus::Success) { + return; + } + + setSuccess(); +} + +std::unique_ptr AccessAsAnyTestBeh::create(alica::BehaviourContext& context) +{ + return std::make_unique(context); +} + +} /* namespace alica */ diff --git a/alica_tests/src/behaviours/BlackboardExceptionTestBeh.cpp b/alica_tests/src/behaviours/BlackboardExceptionTestBeh.cpp new file mode 100644 index 000000000..f90d8a941 --- /dev/null +++ b/alica_tests/src/behaviours/BlackboardExceptionTestBeh.cpp @@ -0,0 +1,71 @@ +#include +#include +#include + +namespace alica +{ + +BlackboardExceptionTestBeh::BlackboardExceptionTestBeh(BehaviourContext& context) + : BasicBehaviour(context) +{ +} +void BlackboardExceptionTestBeh::initialiseParameters() +{ + LockedBlackboardRW bb(*getBlackboard()); + bb.set("boolValue", true); + bb.set("planStatus", PlanStatus::Success); + + try { + bb.get("boolValue"); + LockedBlackboardRW gb(*getGlobalBlackboard()); + gb.set("testError", "Error: No exception in blackboard after accessing boolValue with wrong type std::string!"); + return; + } catch (const BlackboardException& e) { + // nothing to do + } + + try { + bb.get("unknownKey"); + LockedBlackboardRW gb(*getGlobalBlackboard()); + gb.set("testError", "Error: No exception in blackboard after accessing unknown key!"); + } catch (const BlackboardException& e) { + // nothing to do + } + + try { + bb.get("planStatus"); + LockedBlackboardRW gb(*getGlobalBlackboard()); + gb.set("testError", "Error: No exception in blackboard after accessing custom type with wrong type!"); + return; + } catch (const BlackboardException& e) { + // nothing to do + } + + try { + bb.get("planStatus"); + LockedBlackboardRW gb(*getGlobalBlackboard()); + gb.set("testError", "Error: No exception in blackboard after accessing custom type with wrong custom type!"); + return; + } catch (const BlackboardException& e) { + // nothing to do + } + + try { + bb.set("boolValue", "invalidValue"); + LockedBlackboardRW gb(*getGlobalBlackboard()); + gb.set("testError", "Error: No exception in blackboard after setting blackboard value with the wrong type!"); + return; + } catch (const BlackboardException& e) { + // nothing to do + } + + // all exceptions are thrown correctly + setSuccess(); +} + +std::unique_ptr BlackboardExceptionTestBeh::create(alica::BehaviourContext& context) +{ + return std::make_unique(context); +} + +} /* namespace alica */ diff --git a/alica_tests/src/behaviours/InheritFromParentCTestBeh.cpp b/alica_tests/src/behaviours/InheritFromParentCTestBeh.cpp new file mode 100644 index 000000000..cf4d478ae --- /dev/null +++ b/alica_tests/src/behaviours/InheritFromParentCTestBeh.cpp @@ -0,0 +1,32 @@ +#include +#include + +namespace alica +{ + +InheritFromParentCTestBeh::InheritFromParentCTestBeh(BehaviourContext& context) + : BasicBehaviour(context) +{ +} +void InheritFromParentCTestBeh::initialiseParameters() +{ + LockedBlackboardRW bb(*getBlackboard()); + if (bb.hasValue("boolValueA") || bb.hasValue("stringValueA") || bb.hasValue("intValueA") || bb.hasValue("uintValueA") || bb.hasValue("doubleValueA")) { + LockedBlackboardRW gb(*getGlobalBlackboard()); + gb.set("testError", "Child NotInheritFromParentBTestPlan inherits blackboard from parent InheritFromParentATestPlan, but should not inherit!"); + return; + } + + if (bb.get("boolValueB") == false && bb.get("doubleValueB") == 3.0 && bb.get("intValueB") == 3 && + bb.get("uintValueB") == 3u, + bb.get("stringValueB") == "stringFromB") { + setSuccess(); + } +} + +std::unique_ptr InheritFromParentCTestBeh::create(alica::BehaviourContext& context) +{ + return std::make_unique(context); +} + +} /* namespace alica */ diff --git a/alica_tests/src/behaviours/OverwriteValueWithDifferentTypeTestBeh.cpp b/alica_tests/src/behaviours/OverwriteValueWithDifferentTypeTestBeh.cpp new file mode 100644 index 000000000..562656904 --- /dev/null +++ b/alica_tests/src/behaviours/OverwriteValueWithDifferentTypeTestBeh.cpp @@ -0,0 +1,35 @@ +#include +#include +#include +#include + +namespace alica +{ + +OverwriteValueWithDifferentTypeTestBeh::OverwriteValueWithDifferentTypeTestBeh(BehaviourContext& context) + : BasicBehaviour(context) +{ +} +void OverwriteValueWithDifferentTypeTestBeh::initialiseParameters() +{ + // LockedBlackboardRW bb(*getBlackboard()); + // bb.set("anyValue", PlanStatus::Success); + + // if (bb.get("anyValue") != PlanStatus::Success) { + // return; + // } + + // bb.set("anyValue", UnknownType(15)); + // if (bb.get("anyValue").value != 15) { + // return; + // } + + setSuccess(); +} + +std::unique_ptr OverwriteValueWithDifferentTypeTestBeh::create(alica::BehaviourContext& context) +{ + return std::make_unique(context); +} + +} /* namespace alica */ diff --git a/alica_tests/src/behaviours/SetAsAnyTestBeh.cpp b/alica_tests/src/behaviours/SetAsAnyTestBeh.cpp new file mode 100644 index 000000000..4b90ecabe --- /dev/null +++ b/alica_tests/src/behaviours/SetAsAnyTestBeh.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include + +namespace alica +{ + +SetAsAnyTestBeh::SetAsAnyTestBeh(BehaviourContext& context) + : BasicBehaviour(context) +{ +} + +void SetAsAnyTestBeh::initialiseParameters() +{ + LockedBlackboardRW bb(*getBlackboard()); + bb.set("anyValue", std::any{true}); + + if (!bb.get("anyValue")) { + return; + } + + setSuccess(); +} + +std::unique_ptr SetAsAnyTestBeh::create(alica::BehaviourContext& context) +{ + return std::make_unique(context); +} + +} /* namespace alica */ diff --git a/alica_tests/src/behaviours/SetWithSpecifyingTypeTestBeh.cpp b/alica_tests/src/behaviours/SetWithSpecifyingTypeTestBeh.cpp new file mode 100644 index 000000000..bfd73d524 --- /dev/null +++ b/alica_tests/src/behaviours/SetWithSpecifyingTypeTestBeh.cpp @@ -0,0 +1,31 @@ +#include +#include +#include +#include + +namespace alica +{ + +SetWithSpecifyingTypeTestBeh::SetWithSpecifyingTypeTestBeh(BehaviourContext& context) + : BasicBehaviour(context) +{ +} + +void SetWithSpecifyingTypeTestBeh::initialiseParameters() +{ + LockedBlackboardRW bb(*getBlackboard()); + bb.set("anyValue", PlanStatus::Success); + + if (bb.get("anyValue") != PlanStatus::Success) { + return; + } + + setSuccess(); +} + +std::unique_ptr SetWithSpecifyingTypeTestBeh::create(alica::BehaviourContext& context) +{ + return std::make_unique(context); +} + +} /* namespace alica */ diff --git a/alica_tests/src/plans/InheritFromParentATestPlan.cpp b/alica_tests/src/plans/InheritFromParentATestPlan.cpp new file mode 100644 index 000000000..86a17ab91 --- /dev/null +++ b/alica_tests/src/plans/InheritFromParentATestPlan.cpp @@ -0,0 +1,19 @@ +#include +#include + +namespace alica +{ +InheritFromParentATestPlan::InheritFromParentATestPlan(PlanContext& context) + : AlicaTestsPlan(context) +{ +} +void InheritFromParentATestPlan::onTerminate() +{ + LockedBlackboardRW bb(*getBlackboard()); + bb.set("boolValueA", true); + bb.set("doubleValueA", 2.0); + bb.set("intValueA", 2); + bb.set("stringValueA", std::string("setString")); + bb.set("uintValueA", 2u); +} +} // namespace alica diff --git a/alica_tests/src/plans/NotInheritFromParentBTestPlan copy.cpp b/alica_tests/src/plans/NotInheritFromParentBTestPlan copy.cpp new file mode 100644 index 000000000..f37dfbd1f --- /dev/null +++ b/alica_tests/src/plans/NotInheritFromParentBTestPlan copy.cpp @@ -0,0 +1,24 @@ +#include +#include + +namespace alica +{ +NotInheritFromParentBTestPlan::NotInheritFromParentBTestPlan(PlanContext& context) + : AlicaTestsPlan(context) +{ +} +void NotInheritFromParentBTestPlan::onInit() +{ + LockedBlackboardRW bb(*getBlackboard()); + if (bb.hasValue("boolValueA") || bb.hasValue("stringValueA") || bb.hasValue("intValueA") || bb.hasValue("uintValueA") || bb.hasValue("doubleValueA")) { + LockedBlackboardRW gb(*getGlobalBlackboard()); + gb.set("testError", "Child NotInheritFromParentBTestPlan inherits blackboard from parent InheritFromParentATestPlan, but should not inherit!"); + } else { + bb.set("boolValueB", false); + bb.set("doubleValueB", 3.0); + bb.set("intValueB", 3); + bb.set("uintValueB", 3u); + bb.set("stringValueB", std::string("stringFromB")); + } +} +} // namespace alica diff --git a/alica_tests/src/test/test_blackboard.cpp b/alica_tests/src/test/test_blackboard.cpp index 72ead70d2..3e9a6c142 100644 --- a/alica_tests/src/test/test_blackboard.cpp +++ b/alica_tests/src/test/test_blackboard.cpp @@ -592,4 +592,120 @@ TEST_F(SingleAgentTestFixture, testPopulateBlackboardPlan) STEP_UNTIL_ASSERT_TRUE(_tc, _tc->isSuccess(_tc->getActivePlan("BlackboardTestPlan"))); } +TEST_F(SingleAgentTestFixture, testBlackboardInheritance) +{ + // Checks if inheriting blackboard from a parent plan works as expected + + // Transition to the plan corresponding to this test case + ASSERT_TRUE(_tc->setTransitionCond("TestMasterPlan", "ChooseTestState", "BlackboardTestState")) << _tc->getLastFailure(); + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->getActivePlan("BlackboardTestPlan")) << _tc->getLastFailure(); + ASSERT_TRUE(_tc->setTransitionCond("BlackboardTestPlan", "ChooseBlackboardTestState", "InheritFromParentTestState")) << _tc->getLastFailure(); + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->getActivePlan("InheritFromParentTestPlan")) << _tc->getLastFailure(); + + // start test + ASSERT_TRUE(_tc->setTransitionCond("InheritFromParentTestPlan", "WaitForStartState", "RunChildState")) << _tc->getLastFailure(); + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->getActivePlan("InheritFromParentATestPlan")) << _tc->getLastFailure(); + + // Check that child B inherits bb from parent A + ASSERT_TRUE(_tc->setTransitionCond("InheritFromParentATestPlan", "WaitForChildCheckState", "BoolCheckState")) << _tc->getLastFailure(); + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->isStateActive("InheritFromParentATestPlan", "WaitState")) << _tc->getLastFailure(); + + // Check that child C does not inherit bb from B, but child D does inherit bb from C + ASSERT_TRUE(_tc->setTransitionCond("InheritFromParentATestPlan", "WaitState", "RunChildState")) << _tc->getLastFailure(); + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->isStateActive("InheritFromParentTestPlan", "WaitForCheckState")) << _tc->getLastFailure(); + + // // Check that changes to bb done by B are reflected in bb of A + ASSERT_TRUE(_tc->setTransitionCond("InheritFromParentTestPlan", "WaitForCheckState", "CheckBoolState")) << _tc->getLastFailure(); + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->isSuccess(_tc->getActivePlan("BlackboardTestPlan"))) << _tc->getLastFailure(); +} + +TEST_F(SingleAgentTestFixture, testBlackboardExceptions) +{ + // Checks if inheriting blackboard from a parent plan works as expected + + // Transition to the plan corresponding to this test case + ASSERT_TRUE(_tc->setTransitionCond("TestMasterPlan", "ChooseTestState", "BlackboardTestState")) << _tc->getLastFailure(); + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->getActivePlan("BlackboardTestPlan")) << _tc->getLastFailure(); + ASSERT_TRUE(_tc->setTransitionCond("BlackboardTestPlan", "ChooseBlackboardTestState", "BlackboardExceptionTestState")) << _tc->getLastFailure(); + + // Ensure exceptions are thrown correctly + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->isSuccess(_tc->getActivePlan("BlackboardTestPlan"))); +} + +TEST_F(SingleAgentTestFixture, testOverwriteAnyValueWithDifferentType) +{ + // Checks if a blackboard value of type any can be overwritten with a value of type any + + // Transition to the plan corresponding to this test case + ASSERT_TRUE(_tc->setTransitionCond("TestMasterPlan", "ChooseTestState", "BlackboardTestState")) << _tc->getLastFailure(); + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->getActivePlan("BlackboardTestPlan")) << _tc->getLastFailure(); + ASSERT_TRUE(_tc->setTransitionCond("BlackboardTestPlan", "ChooseBlackboardTestState", "BlackboardAnyTestState")) << _tc->getLastFailure(); + + // Enter any test plan + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->getActivePlan("BlackboardAnyTestPlan")) << _tc->getLastFailure(); + + // Transition into test + ASSERT_TRUE(_tc->setTransitionCond("BlackboardAnyTestPlan", "ChooseTestState", "OverwriteValueWithDifferentTypeTestState")) << _tc->getLastFailure(); + + // Ensure that any value can be overwritten with a different internal type + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->isSuccess(_tc->getActivePlan("BlackboardTestPlan"))); +} + +TEST_F(SingleAgentTestFixture, testSetAnyValueOnBlackboard) +{ + // Checks if a blackboard value of type std::any can be set directly on the blackboard + + // Transition to the plan corresponding to this test case + ASSERT_TRUE(_tc->setTransitionCond("TestMasterPlan", "ChooseTestState", "BlackboardTestState")) << _tc->getLastFailure(); + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->getActivePlan("BlackboardTestPlan")) << _tc->getLastFailure(); + ASSERT_TRUE(_tc->setTransitionCond("BlackboardTestPlan", "ChooseBlackboardTestState", "BlackboardAnyTestState")) << _tc->getLastFailure(); + + // Enter any test plan + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->getActivePlan("BlackboardAnyTestPlan")) << _tc->getLastFailure(); + + // Transition into test + ASSERT_TRUE(_tc->setTransitionCond("BlackboardAnyTestPlan", "ChooseTestState", "SetAsAnyTestState")) << _tc->getLastFailure(); + + // Ensure that a value of type std::any can be set as a value directly + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->isSuccess(_tc->getActivePlan("BlackboardTestPlan"))); +} + +TEST_F(SingleAgentTestFixture, testSetAnyWithSpecifyingType) +{ + // Checks if a blackboard value of type std::any can be set with specifying the type, e.g. bb.set("planStatus", PlanStatus::Success); + + // Transition to the plan corresponding to this test case + ASSERT_TRUE(_tc->setTransitionCond("TestMasterPlan", "ChooseTestState", "BlackboardTestState")) << _tc->getLastFailure(); + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->getActivePlan("BlackboardTestPlan")) << _tc->getLastFailure(); + ASSERT_TRUE(_tc->setTransitionCond("BlackboardTestPlan", "ChooseBlackboardTestState", "BlackboardAnyTestState")) << _tc->getLastFailure(); + + // Enter any test plan + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->getActivePlan("BlackboardAnyTestPlan")) << _tc->getLastFailure(); + + // Transition into test + ASSERT_TRUE(_tc->setTransitionCond("BlackboardAnyTestPlan", "ChooseTestState", "SetWithSpecifyingTypeTestState")) << _tc->getLastFailure(); + + // Ensure that a value of type std::any can be set with specifying the type + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->isSuccess(_tc->getActivePlan("BlackboardTestPlan"))); +} + +TEST_F(SingleAgentTestFixture, testAccessBlackboardValueAsAny) +{ + // Checks if a blackboard value of type std::any can be accessed as an any value, e.g. bb.get("planStatus"); + + // Transition to the plan corresponding to this test case + ASSERT_TRUE(_tc->setTransitionCond("TestMasterPlan", "ChooseTestState", "BlackboardTestState")) << _tc->getLastFailure(); + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->getActivePlan("BlackboardTestPlan")) << _tc->getLastFailure(); + ASSERT_TRUE(_tc->setTransitionCond("BlackboardTestPlan", "ChooseBlackboardTestState", "BlackboardAnyTestState")) << _tc->getLastFailure(); + + // Enter any test plan + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->getActivePlan("BlackboardAnyTestPlan")) << _tc->getLastFailure(); + + // Transition into test + ASSERT_TRUE(_tc->setTransitionCond("BlackboardAnyTestPlan", "ChooseTestState", "AccessAsAnyTestState")) << _tc->getLastFailure(); + + // Ensure that a value of type std::any can be accessed as an any value directly + STEP_UNTIL_ASSERT_TRUE(_tc, _tc->isSuccess(_tc->getActivePlan("BlackboardTestPlan"))); +} + } // namespace alica::test