当前位置: 首页>>代码示例>>Python>>正文


Python State.newPathSegment方法代码示例

本文整理汇总了Python中state.State.newPathSegment方法的典型用法代码示例。如果您正苦于以下问题:Python State.newPathSegment方法的具体用法?Python State.newPathSegment怎么用?Python State.newPathSegment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在state.State的用法示例。


在下文中一共展示了State.newPathSegment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_newSegment_None

# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import newPathSegment [as 别名]
 def test_newSegment_None(self):
     point = PointMsg() # initial point
     testState = State(point=point)
     testState.newPathSegment() # putting in a new segment shouldn't overwrite the point by default
     self.assertEqual(testState.pathSeg, None, str(testState.pathSeg) + " is not None")
     self.assertEqual(testState.pathPoint, None, str(testState.pathPoint) + " is not None")
     self.assertEqual(testState.point, point, str(testState.pathPoint) + " is not " + str(point))
     self.assertEqual(testState.segDistDone, 0.0, str(testState.segDistDone) + " is not 0.0")
     self.assertEqual(testState.dt, 1/20.0, str(testState.dt) + " is not " + str(1/20.0))
开发者ID:markschultz,项目名称:EECS-376-Alpha,代码行数:11,代码来源:stateTests.py

示例2: test_newSegment_PathSeg

# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import newPathSegment [as 别名]
 def test_newSegment_PathSeg(self):
     point = PointMsg()  # initial point
     pathSeg = PathSegmentMsg()
     testState = State(point=point)
     testState.newPathSegment(pathSeg)
     self.assertEqual(testState.pathSeg, pathSeg, str(testState.pathSeg) + " is not " + str(pathSeg))
     self.assertEqual(testState.pathPoint, pathSeg.ref_point, str(testState.pathPoint) + " is not " + str(pathSeg.ref_point))
     self.assertEqual(testState.point, point, str(testState.point) + " is not " + str(point))
     self.assertEqual(testState.segDistDone, 0.0, str(testState.segDistDone) + " is not 0.0")
     self.assertEqual(testState.dt, 1/20.0, str(testState.dt) + " is not " + str(1/20.0))
开发者ID:markschultz,项目名称:EECS-376-Alpha,代码行数:12,代码来源:stateTests.py

示例3: test_newSegment_PathSegWithNonZeroDistance

# 需要导入模块: from state import State [as 别名]
# 或者: from state.State import newPathSegment [as 别名]
 def test_newSegment_PathSegWithNonZeroDistance(self):
     testState = State() 
     testState.segDistDone = 5.0
     pathSeg = PathSegmentMsg()
     testState.newPathSegment(pathSeg)
     
     self.assertEqual(testState.pathSeg, pathSeg)
     self.assertEqual(testState.pathPoint, pathSeg.ref_point)
     self.assertEqual(testState.point, pathSeg.ref_point)
     self.assertEqual(testState.segDistDone, 0.0)
     self.assertEqual(testState.dt, 1/20.0)
开发者ID:markschultz,项目名称:EECS-376-Alpha,代码行数:13,代码来源:stateTests.py


注:本文中的state.State.newPathSegment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。