mirror of
https://github.com/jjaldridge2009/Project_Xs.git
synced 2024-10-03 22:07:09 +02:00
This commit is contained in:
commit
1e714a7f54
@ -45,12 +45,11 @@ def getS_munchlax(intervals):
|
|||||||
t = getTrans()
|
t = getTrans()
|
||||||
t_ = getTrans()
|
t_ = getTrans()
|
||||||
|
|
||||||
s = np.zeros((128,128),"uint8")
|
s = np.zeros((144,128),"uint8")
|
||||||
safe_intervals = []
|
safe_intervals = []
|
||||||
for i in range(32):
|
for i in range(36):
|
||||||
#intervals[-1]を挿入した際のインデックスが奇数だと危険な値の可能性がある
|
#intervals[-1]を挿入した際のインデックスが奇数だと危険な値の可能性がある
|
||||||
is_carriable = bisect(section,intervals[-1])%2==1
|
is_carriable = bisect(section,intervals[-1])%2==1
|
||||||
|
|
||||||
while is_carriable:
|
while is_carriable:
|
||||||
#スキップする
|
#スキップする
|
||||||
t = t@t_%2
|
t = t@t_%2
|
||||||
@ -86,6 +85,7 @@ def gauss_jordan(mat,observed:list):
|
|||||||
res[j],res[pivot] = res[pivot],res[j]
|
res[j],res[pivot] = res[pivot],res[j]
|
||||||
if isfound:
|
if isfound:
|
||||||
pivot += 1
|
pivot += 1
|
||||||
|
|
||||||
for i in range(c):
|
for i in range(c):
|
||||||
check = 1<<(c-i-1)
|
check = 1<<(c-i-1)
|
||||||
assert bitmat[i]&check>0
|
assert bitmat[i]&check>0
|
||||||
|
@ -347,7 +347,7 @@ class Application(tk.Frame):
|
|||||||
for _ in range(self.config_json["timeline_npc"]+1):
|
for _ in range(self.config_json["timeline_npc"]+1):
|
||||||
heapq.heappush(queue, (waituntil+1.017,0))
|
heapq.heappush(queue, (waituntil+1.017,0))
|
||||||
for _ in range(self.config_json["pokemon_npc"]):
|
for _ in range(self.config_json["pokemon_npc"]):
|
||||||
blink_int = self.rng.rangefloat(100.0, 370.0)/30 - 0.048
|
blink_int = self.rng.rangefloat(3,12) + 0.285
|
||||||
heapq.heappush(queue, (waituntil+blink_int,1))
|
heapq.heappush(queue, (waituntil+blink_int,1))
|
||||||
|
|
||||||
self.count_down = 10
|
self.count_down = 10
|
||||||
@ -372,7 +372,7 @@ class Application(tk.Frame):
|
|||||||
print(f"advances:{self.advances}, blink:{hex(r&0xF)}")
|
print(f"advances:{self.advances}, blink:{hex(r&0xF)}")
|
||||||
heapq.heappush(queue, (w+1.017, 0))
|
heapq.heappush(queue, (w+1.017, 0))
|
||||||
else:
|
else:
|
||||||
blink_int = self.rng.rangefloat(100.0, 370.0)/30 - 0.048
|
blink_int = self.rng.rangefloat(3,12) + 0.285
|
||||||
|
|
||||||
heapq.heappush(queue, (w+blink_int, 1))
|
heapq.heappush(queue, (w+blink_int, 1))
|
||||||
print(f"advances:{self.advances}, interval:{blink_int}")
|
print(f"advances:{self.advances}, interval:{blink_int}")
|
||||||
@ -445,7 +445,7 @@ class Application(tk.Frame):
|
|||||||
for _ in range(self.config_json["timeline_npc"]):
|
for _ in range(self.config_json["timeline_npc"]):
|
||||||
heapq.heappush(queue, (waituntil+1.017,0))
|
heapq.heappush(queue, (waituntil+1.017,0))
|
||||||
for _ in range(self.config_json["pokemon_npc"]):
|
for _ in range(self.config_json["pokemon_npc"]):
|
||||||
blink_int = self.rng.rangefloat(100.0, 370.0)/30 - 0.048
|
blink_int = self.rng.rangefloat(3,12) + 0.285
|
||||||
heapq.heappush(queue, (waituntil+blink_int,1))
|
heapq.heappush(queue, (waituntil+blink_int,1))
|
||||||
|
|
||||||
self.count_down = 10
|
self.count_down = 10
|
||||||
@ -470,7 +470,7 @@ class Application(tk.Frame):
|
|||||||
print(f"advances:{self.advances}, blink:{hex(r&0xF)}")
|
print(f"advances:{self.advances}, blink:{hex(r&0xF)}")
|
||||||
heapq.heappush(queue, (w+1.017, 0))
|
heapq.heappush(queue, (w+1.017, 0))
|
||||||
else:
|
else:
|
||||||
blink_int = self.rng.rangefloat(100.0, 370.0)/30 - 0.048
|
blink_int = self.rng.rangefloat(3,12) + 0.285
|
||||||
|
|
||||||
heapq.heappush(queue, (w+blink_int, 1))
|
heapq.heappush(queue, (w+blink_int, 1))
|
||||||
print(f"advances:{self.advances}, interval:{blink_int}")
|
print(f"advances:{self.advances}, interval:{blink_int}")
|
||||||
|
@ -47,7 +47,7 @@ def tracking_blink(img, roi_x, roi_y, roi_w, roi_h, th = 0.9, size = 40, Monitor
|
|||||||
state = IDLE
|
state = IDLE
|
||||||
blinks = []
|
blinks = []
|
||||||
intervals = []
|
intervals = []
|
||||||
prev_time = 0
|
prev_time = time.perf_counter()
|
||||||
w, h = eye.shape[::-1]
|
w, h = eye.shape[::-1]
|
||||||
|
|
||||||
prev_roi = None
|
prev_roi = None
|
||||||
@ -227,7 +227,7 @@ def tracking_poke_blink(img, roi_x, roi_y, roi_w, roi_h, size = 60, MonitorWindo
|
|||||||
if (roi==prev_roi).all():
|
if (roi==prev_roi).all():
|
||||||
continue
|
continue
|
||||||
prev_roi = roi
|
prev_roi = roi
|
||||||
|
|
||||||
res = cv2.matchTemplate(roi,eye,cv2.TM_CCOEFF_NORMED)
|
res = cv2.matchTemplate(roi,eye,cv2.TM_CCOEFF_NORMED)
|
||||||
_, match, _, max_loc = cv2.minMaxLoc(res)
|
_, match, _, max_loc = cv2.minMaxLoc(res)
|
||||||
|
|
||||||
@ -353,7 +353,7 @@ def recovByMunchlax(rawintervals:List[float])->Xorshift:
|
|||||||
states = prng.getState()
|
states = prng.getState()
|
||||||
|
|
||||||
#validation check
|
#validation check
|
||||||
expected_intervals = [randrange(r,100,370)/30 for r in prng.getNextRandSequence(advances)]
|
expected_intervals = [randrange(r,100,370) for r in prng.getNextRandSequence(advances)]
|
||||||
|
|
||||||
paired = list(zip(intervals,expected_intervals))
|
paired = list(zip(intervals,expected_intervals))
|
||||||
#print(paired)
|
#print(paired)
|
||||||
|
@ -117,11 +117,12 @@ def stationary_timeline():
|
|||||||
#whiteout
|
#whiteout
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
waituntil = time.perf_counter()
|
waituntil = time.perf_counter()
|
||||||
print("entered the stationary symbol room")
|
print("enter the stationary symbol room")
|
||||||
queue = []
|
queue = []
|
||||||
heapq.heappush(queue, (waituntil+1.017,0))
|
heapq.heappush(queue, (waituntil+1.017,0))
|
||||||
|
|
||||||
blink_int = reidentified_rng.rangefloat(100.0, 370.0)/30 - 0.048
|
#blink_int = reidentified_rng.range(3.0, 12.0) + 0.3
|
||||||
|
blink_int = reidentified_rng.rangefloat(3,12) + 0.3
|
||||||
|
|
||||||
heapq.heappush(queue, (waituntil+blink_int,1))
|
heapq.heappush(queue, (waituntil+blink_int,1))
|
||||||
while queue:
|
while queue:
|
||||||
@ -136,7 +137,8 @@ def stationary_timeline():
|
|||||||
print(f"advances:{advances}, blink:{hex(r&0xF)}")
|
print(f"advances:{advances}, blink:{hex(r&0xF)}")
|
||||||
heapq.heappush(queue, (w+1.017, 0))
|
heapq.heappush(queue, (w+1.017, 0))
|
||||||
else:
|
else:
|
||||||
blink_int = reidentified_rng.rangefloat(100.0, 370.0)/30 - 0.048
|
#blink_int = reidentified_rng.range(3.0, 12.0) + 0.285
|
||||||
|
blink_int = reidentified_rng.rangefloat(3,12) + 0.285
|
||||||
|
|
||||||
heapq.heappush(queue, (w+blink_int, 1))
|
heapq.heappush(queue, (w+blink_int, 1))
|
||||||
print(f"advances:{advances}, interval:{blink_int}")
|
print(f"advances:{advances}, interval:{blink_int}")
|
||||||
|
@ -32,7 +32,7 @@ def expr():
|
|||||||
if munch_eye is None:
|
if munch_eye is None:
|
||||||
print("path is wrong")
|
print("path is wrong")
|
||||||
return
|
return
|
||||||
gombe_intervals = rngtool.tracking_poke_blink(munch_eye, *config["view"], size=60, MonitorWindow=config["MonitorWindow"], WindowPrefix=config["WindowPrefix"])
|
gombe_intervals = rngtool.tracking_poke_blink(munch_eye, *config["view"], size=64, MonitorWindow=config["MonitorWindow"], WindowPrefix=config["WindowPrefix"])
|
||||||
|
|
||||||
interval_prng = rngtool.recovByMunchlax(gombe_intervals)
|
interval_prng = rngtool.recovByMunchlax(gombe_intervals)
|
||||||
state = interval_prng.getState()
|
state = interval_prng.getState()
|
||||||
@ -40,7 +40,7 @@ def expr():
|
|||||||
#timecounter reset
|
#timecounter reset
|
||||||
advances = 0
|
advances = 0
|
||||||
id_prng = Xorshift(*interval_prng.getState())
|
id_prng = Xorshift(*interval_prng.getState())
|
||||||
id_prng.getNextRandSequence(1)
|
id_prng.next()
|
||||||
|
|
||||||
waituntil = time.perf_counter()
|
waituntil = time.perf_counter()
|
||||||
ts = time.time()
|
ts = time.time()
|
||||||
@ -48,8 +48,8 @@ def expr():
|
|||||||
#ID予測開始
|
#ID予測開始
|
||||||
while True:
|
while True:
|
||||||
advances += 1
|
advances += 1
|
||||||
r = interval_prng.next()
|
interval = interval_prng.rangefloat(3.0,12.0) + 0.285
|
||||||
interval = randrange(r, 100, 370)/30 - 0.048
|
#interval = interval_prng.range(3.0,12.0) + 0.285
|
||||||
waituntil += interval
|
waituntil += interval
|
||||||
|
|
||||||
id_r = id_prng.next()
|
id_r = id_prng.next()
|
||||||
|
Loading…
Reference in New Issue
Block a user