File size: 764 Bytes
bb6d2aa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from __future__ import annotations

from dataclasses import dataclass, field
from typing import Any

from staplebridge.chemistry.state import StapleState


@dataclass
class TransitionStep:
    state: StapleState
    next_state: StapleState
    candidates: list[StapleState]
    chosen_idx: int
    t: int


@dataclass
class WeightedTrajectory:
    steps: list[TransitionStep]
    terminal_state: StapleState
    terminal_energy: float
    weight: float = 0.0
    context: dict[str, Any] = field(default_factory=dict)
    # Hydrocarbon Exact-SB uses these fields to keep plan-conditioned positive
    # paths separate from off-plan/unfinished failures.  Defaults preserve all
    # legacy callers.
    is_positive: bool = True
    failure_reason: str | None = None