本文整理汇总了Python中nupic.encoders.geospatial_coordinate.GeospatialCoordinateEncoder.radiusForSpeed方法的典型用法代码示例。如果您正苦于以下问题:Python GeospatialCoordinateEncoder.radiusForSpeed方法的具体用法?Python GeospatialCoordinateEncoder.radiusForSpeed怎么用?Python GeospatialCoordinateEncoder.radiusForSpeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nupic.encoders.geospatial_coordinate.GeospatialCoordinateEncoder
的用法示例。
在下文中一共展示了GeospatialCoordinateEncoder.radiusForSpeed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testRadiusForSpeed
# 需要导入模块: from nupic.encoders.geospatial_coordinate import GeospatialCoordinateEncoder [as 别名]
# 或者: from nupic.encoders.geospatial_coordinate.GeospatialCoordinateEncoder import radiusForSpeed [as 别名]
def testRadiusForSpeed(self):
scale = 30 # meters
timestep = 60 #seconds
speed = 50 # meters per second
encoder = GeospatialCoordinateEncoder(scale, timestep)
radius = encoder.radiusForSpeed(speed)
self.assertEqual(radius, 75)
示例2: testRadiusForSpeedInt
# 需要导入模块: from nupic.encoders.geospatial_coordinate import GeospatialCoordinateEncoder [as 别名]
# 或者: from nupic.encoders.geospatial_coordinate.GeospatialCoordinateEncoder import radiusForSpeed [as 别名]
def testRadiusForSpeedInt(self):
"""Test that radius will round to the nearest integer"""
scale = 30 # meters
timestep = 62 #seconds
speed = 25 # meters per second
encoder = GeospatialCoordinateEncoder(scale, timestep)
radius = encoder.radiusForSpeed(speed)
self.assertEqual(radius, 38)
示例3: testRadiusForSpeed0
# 需要导入模块: from nupic.encoders.geospatial_coordinate import GeospatialCoordinateEncoder [as 别名]
# 或者: from nupic.encoders.geospatial_coordinate.GeospatialCoordinateEncoder import radiusForSpeed [as 别名]
def testRadiusForSpeed0(self):
scale = 30 # meters
timestep = 60 #seconds
speed = 0 # meters per second
n = 999
w = 27
encoder = GeospatialCoordinateEncoder(scale, timestep, n=n, w=w)
radius = encoder.radiusForSpeed(speed)
self.assertEqual(radius, 3)