本文整理汇总了C++中AgentNodeTest类的典型用法代码示例。如果您正苦于以下问题:C++ AgentNodeTest类的具体用法?C++ AgentNodeTest怎么用?C++ AgentNodeTest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AgentNodeTest类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LOAD_TEST
//< Action Nodes Tests
LOAD_TEST(btunittest, action_ut_0)
{
AgentNodeTest* myTestAgent = initTestEnvNode("node_test/action_ut_0", format);
myTestAgent->resetProperties();
ChildNodeTest* testChildAgent = behaviac::Agent::Create<ChildNodeTest>(1, "par_child", 0, 0);
StaticAgent* pStaticAgent = behaviac::Agent::Create<StaticAgent>("StaticAgent");
myTestAgent->testVar_3 = 1;
testChildAgent->testVar_2 = 2;
myTestAgent->SetVariable<ChildNodeTest*>("par_child", testChildAgent);
myTestAgent->btexec();
CHECK_EQUAL(1500, myTestAgent->testVar_0);
CHECK_EQUAL(1800, myTestAgent->testVar_1);
CHECK_EQUAL("null", myTestAgent->testVar_str_0);
CHECK_EQUAL(2, StaticAgent::sInt);
CHECK_EQUAL(true, testChildAgent->m_bTargetValid);
behaviac::Agent::Destroy(testChildAgent);
behaviac::Agent::Destroy(pStaticAgent);
finlTestEnvNode(myTestAgent);
}
示例2: LOAD_TEST
LOAD_TEST(btunittest, decoration_successuntil_ut_1)
{
AgentNodeTest* myTestAgent = initTestEnvNode("node_test/decoration_successuntil_ut_1", format);
myTestAgent->resetProperties();
int loopCount = 0;
while (loopCount < 5)
{
behaviac::EBTStatus status = myTestAgent->btexec();
if (loopCount < 4)
{
CHECK_EQUAL(behaviac::BT_SUCCESS, status);
}
else
{
CHECK_EQUAL(behaviac::BT_FAILURE, status);
}
++loopCount;
}
finlTestEnvNode(myTestAgent);
}
示例3: LOAD_TEST
LOAD_TEST(btunittest, decoration_countlimit_ut_2)
{
AgentNodeTest* myTestAgent = initTestEnvNode("node_test/decoration_countlimit_ut_2", format);
myTestAgent->resetProperties();
int loopCount = 0;
while (loopCount < 11)
{
if (loopCount == 5)
{
myTestAgent->testVar_1 = 0;
myTestAgent->testVar_2 = 0.0f;
}
myTestAgent->btexec();
myTestAgent->testVar_1 = -1;
if (loopCount < 10)
{
CHECK_EQUAL(0, myTestAgent->testVar_0);
}
else
{
CHECK_EQUAL(1, myTestAgent->testVar_0);
}
++loopCount;
}
finlTestEnvNode(myTestAgent);
}
示例4: LOAD_TEST
LOAD_TEST(btunittest, parallel_ut_2)
{
AgentNodeTest* myTestAgent = initTestEnvNode("node_test/parallel_ut_2", format);
myTestAgent->resetProperties();
myTestAgent->btexec();
CHECK_EQUAL(2, myTestAgent->testVar_0);
finlTestEnvNode(myTestAgent);
}
示例5: LOAD_TEST
LOAD_TEST(btunittest, predicate_sequence_ut_1)
{
AgentNodeTest* myTestAgent = initTestEnvNode("node_test/predicate_sequence_ut_1", format);
myTestAgent->resetProperties();
behaviac::EBTStatus status = myTestAgent->btexec();
CHECK_EQUAL(behaviac::BT_FAILURE, status);
CHECK_EQUAL(0, myTestAgent->testVar_0);
finlTestEnvNode(myTestAgent);
}