-
Notifications
You must be signed in to change notification settings - Fork 22
/
solution.py
30 lines (26 loc) · 1.11 KB
/
solution.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# PATH
# if you want to call your model ,the path setting is
# NN_MODEL = "/home/team/"$YOUR TEAM NAME"/submit/results/nn_model_ep_18200.ckpt" # model path settings
from simulator.video_player import Player
class Algorithm:
def __init__(self):
# fill your self params
self.buffer_size = 0
# Intial
def Initialize(self):
# Initialize your session or something
self.buffer_size = 0
# Define your algorithm
# The args you can get are as follows:
# 1. delay: the time cost of your last operation
# 2. rebuf: the length of rebufferment
# 3. video_size: the size of the last downloaded chunk
# 4. end_of_video: if the last video was ended
# 5. play_video_id: the id of the current video
# 6. Players: the video data of a RECOMMEND QUEUE of 5 (see specific definitions in readme)
# 7. first_step: is this your first step?
def run(self, delay, rebuf, video_size, end_of_video, play_video_id, Players, first_step=False):
download_video_id = 0
bit_rate = 0
sleep_time = 500.0
return download_video_id, bit_rate, sleep_time