Skip to content

Commit

Permalink
最终配速控制 #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kontori committed Mar 7, 2022
1 parent 9fcade7 commit e76e123
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ single_mileage_max_offset = -1
cadence_min_offset = 30
cadence_max_offset = -150
split_count = 10
min_consume_offset = 1.2
max_consume_offset = 1.35
min_consume = 4.50
max_consume = 5.50

9 changes: 3 additions & 6 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
cadence_max_offset = int(conf.get("Run", "cadence_max_offset"))
split_count = int(conf.get("Run", "split_count"))
exclude_points = json.loads(conf.get("Run", "exclude_points"))
min_consume_offset = float(conf.get("Run", "min_consume_offset"))
max_consume_offset = float(conf.get("Run", "max_consume_offset"))
min_consume = float(conf.get("Run", "min_consume"))
max_consume = float(conf.get("Run", "max_consume"))


def update():
Expand Down Expand Up @@ -177,8 +177,7 @@ def __init__(self):
self.add_task(self.manageList[index]['point'])
index = (index + 1) % self.raDislikes

self.now_time *= random.uniform(min_consume_offset, max_consume_offset)
self.now_time = int(self.now_time)
self.now_time = int(random.uniform(min_consume, max_consume) * 60 * (self.now_dist / 1000))
print('打卡点标记完成!本次将打卡' + str(self.myLikes) + '个点,处理' + str(len(self.task_list)) + '个点,总计'
+ format(self.now_dist / 1000, '.2f')
+ '公里,将耗时' + str(self.now_time // 60) + '分' + str(self.now_time % 60) + '秒')
Expand Down Expand Up @@ -206,7 +205,6 @@ def add_task(self, point):
split_point = []
for path in j['data']['paths']:
self.now_dist += path['distance']
self.now_time += path['duration']
path['steps'][-1]['polyline'] += ';' + point
for step in path['steps']:
polyline = step['polyline']
Expand Down Expand Up @@ -341,7 +339,6 @@ def finish(self):
d = school_list()
my_host = d['schoolUrl']
s_id = d['schoolId']
print(my_host)
while my_token == '':
name = input("请输入学号:")
word = input("请输入密码:")
Expand Down

0 comments on commit e76e123

Please sign in to comment.