MCPcopy Create free account
hub / github.com/Tong89/smartNode / TestHighDecayRate

Class TestHighDecayRate

tests/test_content_value.py:216–232  ·  view source on GitHub ↗

CONTROL 类型 beta=0.5 下的快速衰减场景。

Source from the content-addressed store, hash-verified

214# --------------------------------------------------------------------------- #
215
216class TestHighDecayRate:
217 """CONTROL 类型 beta=0.5 下的快速衰减场景。"""
218
219 def test_control_decay_sharp(self):
220 """CONTROL 类型 10 秒后价值应衰减至约 base_value * exp(-5) ≈ 1%。"""
221 task = _make_task("CONTROL", creation_time=0.0)
222 v10 = task.get_dynamic_value(10.0)
223 expected = task.base_value * math.exp(-0.5 * 10.0)
224 assert v10 == pytest.approx(expected, rel=1e-9)
225 # 10 秒后保留约 0.67% 初始价值
226 assert v10 < task.base_value * 0.01
227
228 def test_control_near_zero_after_long_time(self):
229 """CONTROL 类型经过足够长时间后价值应趋近于零。"""
230 task = _make_task("CONTROL", creation_time=0.0)
231 v_late = task.get_dynamic_value(100.0)
232 assert v_late < 1e-15

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected