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


Python Schedule.add_lesson方法代码示例

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


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

示例1: should_add_up

# 需要导入模块: from schedule import Schedule [as 别名]
# 或者: from schedule.Schedule import add_lesson [as 别名]
        def should_add_up(self):
            schedule = Schedule()
            schedule.add_lesson(RandomWeeklyLesson())
            schedule.add_lesson(RandomWeeklyLesson())

            b = Bins(schedule=schedule)
            b_ = b.bins()

            expect(b[0] + b[1] + b[2] + b[3] + b[4] + b[5]).to.equal(2)
            expect(b_[0] + b_[1] + b_[2] + b_[3] + b_[4] + b_[5]).to.equal(2)
开发者ID:Edderic,项目名称:udacity-machine-learning-nanodegree,代码行数:12,代码来源:bins_spec.py

示例2: generate_sample_schedule

# 需要导入模块: from schedule import Schedule [as 别名]
# 或者: from schedule.Schedule import add_lesson [as 别名]
    def generate_sample_schedule(self, business_forecast):
        schedule = Schedule()

        for i in business_forecast:
            for j in range(0, int(i['frequency'] * i['schedule_type'])):
                schedule.add_lesson(\
                        RandomWeeklyLesson(\
                        start_time_range=self.start_time_range,
                        day_of_week_range=self.day_of_week_range))

        return schedule
开发者ID:Edderic,项目名称:udacity-machine-learning-nanodegree,代码行数:13,代码来源:models.py

示例3: __init__

# 需要导入模块: from schedule import Schedule [as 别名]
# 或者: from schedule.Schedule import add_lesson [as 别名]
    def __init__(self, start_time_range=(0,23.75,), day_of_week_range=(0,6,)):
        self.start_time_range = start_time_range
        self.day_of_week_range = day_of_week_range

        schedule = Schedule()

        lower_limit_start_time, upper_limit_start_time = start_time_range
        lower_limit_day_of_week, upper_limit_day_of_week = day_of_week_range

        for i in np.linspace(lower_limit_start_time, upper_limit_start_time, 96):
            for j in range(lower_limit_day_of_week, upper_limit_day_of_week + 1):
                schedule.add_lesson( WeeklyLesson(start_time=i, day_of_week=j))

        self.bins = Bins(schedule=schedule).bins()
开发者ID:Edderic,项目名称:udacity-machine-learning-nanodegree,代码行数:16,代码来源:models.py

示例4: it_should_aggregate_the_lesson_requests_per_bin

# 需要导入模块: from schedule import Schedule [as 别名]
# 或者: from schedule.Schedule import add_lesson [as 别名]
        def it_should_aggregate_the_lesson_requests_per_bin(self):
            schedule = Schedule()
            schedule.add_lesson(RandomWeeklyLesson())

            b = Bins(schedule=schedule)
            expect(b.sum().sum()).to.equal(1)
开发者ID:Edderic,项目名称:udacity-machine-learning-nanodegree,代码行数:8,代码来源:bins_spec.py

示例5: by_default_should_be_6

# 需要导入模块: from schedule import Schedule [as 别名]
# 或者: from schedule.Schedule import add_lesson [as 别名]
        def by_default_should_be_6(self):
            schedule = Schedule()
            schedule.add_lesson(RandomWeeklyLesson())

            b = Bins(schedule=schedule)
            expect(b.num_bins()).to.equal(6)
开发者ID:Edderic,项目名称:udacity-machine-learning-nanodegree,代码行数:8,代码来源:bins_spec.py


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