2
This commit is contained in:
@@ -227,6 +227,32 @@ class LocalSimObservationTests(unittest.TestCase):
|
||||
# 误差在 ±1° 内均匀分布,返回值再保留两位小数。
|
||||
self.assertLessEqual(abs(outcome.svd_deg - true_bearing), 1.005)
|
||||
|
||||
def test_same_position_error_is_fixed(self):
|
||||
"""同一(源,位置)重复测量读数不变 [题面/官方演练实测]。"""
|
||||
source = Source(channel=1, x=1000, y=300, r_eff_m=1500)
|
||||
simulator = LocalSimulator([source], robot_id="T001")
|
||||
client = SimulatorClient("T001", transport=LocalSimTransport(simulator))
|
||||
client.enter()
|
||||
first = client.measure((0, 0), 1)
|
||||
second = client.measure((0, 0), 1) # 新 request_id,同位置
|
||||
self.assertEqual(first.result, "direction")
|
||||
self.assertEqual(first.svd_deg, second.svd_deg,
|
||||
"同位置重复测量的示向度必须相同")
|
||||
|
||||
def test_error_field_deterministic_per_seed(self):
|
||||
"""同种子误差场逐点一致;不同种子得到不同误差场(逐点白噪声)。"""
|
||||
source = Source(channel=1, x=1000, y=0, r_eff_m=1500)
|
||||
readings = {}
|
||||
for label, seed in (("a", 1), ("b", 1), ("c", 2)):
|
||||
simulator = LocalSimulator([source], error_seed=seed, robot_id="T001")
|
||||
client = SimulatorClient("T001", transport=LocalSimTransport(simulator))
|
||||
client.enter()
|
||||
readings[label] = [client.measure((float(x), 0.0), 1).svd_deg
|
||||
for x in (0, 100, 200, 300, 400)]
|
||||
self.assertEqual(readings["a"], readings["b"])
|
||||
self.assertNotEqual(readings["a"], readings["c"],
|
||||
"不同种子应在至少一个测点产生不同读数")
|
||||
|
||||
|
||||
class SessionLogTests(unittest.TestCase):
|
||||
def test_log_records_attempts_and_accepted(self):
|
||||
|
||||
Reference in New Issue
Block a user