Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions bdms/poisson.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,12 @@ class ConstantProcess(HomogeneousProcess):

Args:
value: Constant rate.
attr: The name of the :py:class:`bdms.TreeNode` attribute to access. This
is not used by this process, but is included for downstream compatibility.
"""

def __init__(self, value: float = 1.0):
super().__init__()
def __init__(self, value: float = 1.0, attr: str = "state"):
super().__init__(attr=attr)
self.value = value

def λ_homogeneous(
Expand Down
3 changes: 1 addition & 2 deletions bdms/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,7 @@ def slice(self, t: float, attr: str = "x") -> list[Any]:
return [getattr(self, attr)]

def is_leaf_fn(node: TreeNode):
assert node.up is not None
return node.t >= t and node.up.t < t
return node.up is not None and (node.up.t < t <= node.t)

return [
(getattr(node, attr) if node.t == t else getattr(node.up, attr))
Expand Down