本文整理汇总了C++中Candidate::getNextStep方法的典型用法代码示例。如果您正苦于以下问题:C++ Candidate::getNextStep方法的具体用法?C++ Candidate::getNextStep怎么用?C++ Candidate::getNextStep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Candidate
的用法示例。
在下文中一共展示了Candidate::getNextStep方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: obs
TEST(SmallObserverSphere, limitStep) {
SmallObserverSphere obs(Vector3d(0, 0, 0), 1);
Candidate c;
c.setNextStep(10);
c.current.setPosition(Vector3d(0, 0, 2));
obs.process(&c);
EXPECT_DOUBLE_EQ(c.getNextStep(), 1);
}
示例2:
TEST(Observer1D, noDetection) {
Observer1D obs; // observer at x = 0
Candidate c;
c.current.setPosition(Vector3d(5, 0, 0));
c.setNextStep(10);
obs.process(&c);
EXPECT_TRUE(c.isActive());
EXPECT_DOUBLE_EQ(5, c.getNextStep());
}
示例3: ellipsoid
TEST(EllipsoidalBoundary, limitStep) {
EllipsoidalBoundary ellipsoid(Vector3d(-5, 0, 0), Vector3d(5, 0, 0), 15);
ellipsoid.setLimitStep(true);
ellipsoid.setMargin(0.5);
Candidate c;
c.setNextStep(2);
c.current.setPosition(Vector3d(7, 0, 0));
ellipsoid.process(&c);
EXPECT_DOUBLE_EQ(c.getNextStep(), 1.5);
}
示例4: sphere
TEST(SphericalBoundary, limitStep) {
SphericalBoundary sphere(Vector3d(0, 0, 0), 10);
sphere.setLimitStep(true);
sphere.setMargin(1);
Candidate c;
c.setNextStep(100);
c.current.setPosition(Vector3d(0, 0, 9.5));
sphere.process(&c);
EXPECT_DOUBLE_EQ(1.5, c.getNextStep());
}
示例5: cube
TEST(CubicBoundary, limitStepUpper) {
CubicBoundary cube(Vector3d(-10, -10, -10), 10);
cube.setLimitStep(true);
cube.setMargin(1);
Candidate c;
c.current.setPosition(Vector3d(-5, -5, -0.5));
c.setNextStep(100);
cube.process(&c);
EXPECT_DOUBLE_EQ(1.5, c.getNextStep());
}