simpy_terms/transition.py

53 lines
1.2 KiB
Python
Raw Permalink Normal View History

2026-06-20 13:26:29 +03:00
NODES_N = {
("3", "A", "1"),
("2", "1", "B"),
("3", "2", "C"),
}
NODES_N0 = {
("A", "1", "A'"),
("B", "1", "B'"),
("A B", "A", "AB'"),
("A'B", "A'", "A'B'"),
("A'B", "B", "AB"),
("A'B'", "B'", "AB'"),
}
TRANSITIONS: dict[str, str] = {
"000": "000",
"001": "011", # CHANGED (was "0NN") — NOT(0) fires: child wins
"00N": "000",
"010": "NNN",
"011": "011",
"01N": "011",
"0N0": "000",
"0N1": "011",
"0NN": "0NN",
"100": "110", # CHANGED (was "NN0") — NOT(0) fires: child wins
"101": "101", # CHANGED (was "NNN") — NOT(1) holds: result is P="0"
"10N": "10N", # CHANGED (was "NNN") — NOT waiting state: hold
"110": "110",
"111": "111",
"11N": "11N",
"1N0": "110",
"1N1": "111",
"1NN": "11N",
"N00": "000",
"N01": "NNN",
"N0N": "000", # UNCHANGED — required, per design constraint
"N10": "110",
"N11": "N11",
"N1N": "N1N",
"NN0": "NN0",
"NN1": "N11",
"NNN": "NNN",
}
# Original table kept for reference / A-B testing.
TRANSITIONS_ORIGINAL: dict[str, str] = {
**TRANSITIONS,
"100": "NN0",
"101": "NNN",
"10N": "NNN",
"001": "0NN",
}