コード例 #1
0
 def effect3(history: History) -> float:
     value = history.get_event(2)
     if not history.get_event(2, delay=1):
         value *= 1.5
     elif not history.get_event(2, delay=2):
         value *= 3
     elif not history.get_event(2, delay=3):
         value *= 6
     return value
コード例 #2
0
    def promo_delay(history: History) -> float:
        value = 0
        if history.get_event(4):
            value = Uniform(40, 80).generate()
        elif history.get_event(4, delay=1):
            value = Uniform(30, 50).generate()
        elif history.get_event(4, delay=2):
            value = Uniform(0, 20).generate()

        return value
コード例 #3
0
        def effect_function(history: History) -> float:
            value = history.get_event()
            if history.get_event(201, delay=200):
                value *= 1.5
            elif history.get_event(position=301, delay=300, null_value=None):
                value *= 3
            elif history.get_event(delay=500):
                value *= 3
            elif history.get_event(delay=600, position=601):
                value *= 3
            value = history.get_event(401) + 4

            return value
コード例 #4
0
 def sales(history: History) -> float:
     return history.get_event(1) * history.get_event(2)
コード例 #5
0
 def effect2(history: History) -> float:
     week = history.get_datetime().isocalendar()[1]
     ratio = week / 52
     return history.get_event(1) * (1 + ratio / 20)
コード例 #6
0
 def effect1(history: History) -> float:
     day = history.get_datetime().weekday()
     # [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
     ratios = [20, 20, 15, 10, 0, -30, -50]
     return history.get_event(1) * (1 + ratios[day] / 100)
    def pathology(history: History) -> float:
        gene1 = history.get_event(1) > 0.8
        gene2 = history.get_event(2) > 0.7
        gene5 = history.get_event(5) > 0.6

        return gene1 and gene2 or gene5
コード例 #8
0
 def effect_function1(h: History) -> float:
     return h.get_event()
コード例 #9
0
 def effect_function(history: History) -> float:
     return history.get_event()