mirror of
https://github.com/onestardao/WFGY.git
synced 2026-04-28 03:29:51 +00:00
Create bbcr.py
This commit is contained in:
parent
705d6b7db2
commit
b255ac7c4c
1 changed files with 14 additions and 0 deletions
14
wfgy_sdk/bbcr.py
Normal file
14
wfgy_sdk/bbcr.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
def check_collapse(B, Bc=1.2):
|
||||
"""If residue exceeds threshold, trigger reset"""
|
||||
return B > Bc
|
||||
|
||||
def reset_state(state, delta_B):
|
||||
print("Reset triggered. Reinitializing state.")
|
||||
return state * 0.0 + delta_B
|
||||
|
||||
def run_demo():
|
||||
state = 3.0
|
||||
B = 1.5
|
||||
if check_collapse(B):
|
||||
state = reset_state(state, delta_B=0.1)
|
||||
print(f"Post-reset state: {state}")
|
||||
Loading…
Add table
Add a link
Reference in a new issue