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


Python Car.location方法代码示例

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


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

示例1: test_calculate_not_slow_down_when_circling_the_road

# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import location [as 别名]
def test_calculate_not_slow_down_when_circling_the_road():
    my_car = Car()
    car_in_front = Car()
    my_car.speed = 30
    my_car.location = 980
    car_in_front.speed = 25
    car_in_front.location = 20
    assert my_car.calculate_slow_down(car_in_front) == False
开发者ID:tshealy,项目名称:traffic-simulation,代码行数:10,代码来源:test_car.py

示例2: test_calculate_slow_down

# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import location [as 别名]
def test_calculate_slow_down():
    my_car = Car()
    car_in_front = Car()
    my_car.speed = 30
    my_car.location = 80
    car_in_front.speed = 25
    car_in_front.location = 100
    assert my_car.calculate_slow_down(car_in_front) == True
开发者ID:tshealy,项目名称:traffic-simulation,代码行数:10,代码来源:test_car.py

示例3: test_car_that_has_looped_does_not_make_car_behind_slow_down

# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import location [as 别名]
def test_car_that_has_looped_does_not_make_car_behind_slow_down():
    car1 = Car()
    car2 = Car()
    car1.speed = 25
    car2.speed = 27
    car1.location = 15
    car2.location = 980
    assert car2.calculate_slowdown(car1) == False
开发者ID:jdhiggins,项目名称:traffic-simulation,代码行数:10,代码来源:car_test.py

示例4: test_car_that_has_looped_still_makes_car_behind_slow_down

# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import location [as 别名]
def test_car_that_has_looped_still_makes_car_behind_slow_down():
    car1 = Car()
    car2 = Car()
    car1.speed = 25
    car2.speed = 27
    car1.location = 2
    car2.location = 980
    assert car2.calculate_slowdown(car1) == True
开发者ID:jdhiggins,项目名称:traffic-simulation,代码行数:10,代码来源:car_test.py

示例5: test_car_does_not_slow_down

# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import location [as 别名]
def test_car_does_not_slow_down():
    car1 = Car()
    car2 = Car()
    car1.speed = 25
    car2.speed = 27
    car1.location = 115
    car2.location = 80
    assert car2.calculate_slowdown(car1) == False
开发者ID:jdhiggins,项目名称:traffic-simulation,代码行数:10,代码来源:car_test.py

示例6: test_car_decides_to_slow_down

# 需要导入模块: from car import Car [as 别名]
# 或者: from car.Car import location [as 别名]
def test_car_decides_to_slow_down():
    car1 = Car()
    car2 = Car()
    car1.speed = 25
    car2.speed = 27
    car1.location = 100
    car2.location = 80
    assert car2.calculate_slowdown(car1) == True
开发者ID:jdhiggins,项目名称:traffic-simulation,代码行数:10,代码来源:car_test.py


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