feat(spatial): 契约加 conflicts——两份来源打架时,只有两个世界都成立的答案才算答案
This commit is contained in:
1 parent
e799e02e22
commit
a01ca7eab7
9 files changed
+206
-27
No files matched your search
@@ -121,9 +121,18 @@ def edge_features(sc: Scenario, ed, removed: bool, dangling: bool = False) -> li
|
||||
f[N_EDGE + N_AXIS + 2] = geom[0]
|
||||
f[N_EDGE + N_AXIS + 3] = 1.0 if dangling else 0.0
|
||||
f[N_EDGE + N_AXIS + 4:N_EDGE + N_AXIS + 7] = list(geom[1:])
|
||||
f[N_EDGE + N_AXIS + 7] = 1.0 if _disputed(sc, ed) else 0.0
|
||||
return f
|
||||
|
||||
|
||||
def _disputed(sc: Scenario, ed) -> bool:
|
||||
"""Named by two sources and disagreed on. Carries no vote: which source wins
|
||||
is the one thing the system must not decide by itself."""
|
||||
pair = {ed.a, ed.b}
|
||||
return any(c.get("kind") == ed.kind and {c.get("a"), c.get("b")} == pair
|
||||
for c in (sc.obs.conflicts or []))
|
||||
|
||||
|
||||
def scene_features(sc: Scenario, availability: str = "leaked") -> list:
|
||||
"""The observation's own admission of what it is missing.
|
||||
|
||||
|
||||
Reference in new issue
Block a user