-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9795fef
commit 3e3405f
Showing
2 changed files
with
22 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,27 @@ | ||
from typing import Optional | ||
|
||
from .root_node import RootNode | ||
from bamt.core.node_models import EmpiricalDistribution | ||
|
||
|
||
class DiscreteNode(RootNode): | ||
def __init__(self): | ||
def __init__(self, distribution: Optional[EmpiricalDistribution] = None): | ||
""" | ||
Initialize the DisscreteNode with an optional EmpiricalDistribution. | ||
Args: | ||
distribution (Optional[ContinuousDistribution]): A ContinuousDistribution object. | ||
""" | ||
super().__init__() | ||
self._distribution = ( | ||
distribution if distribution is not None else EmpiricalDistribution | ||
) | ||
|
||
def __str__(self) -> str: | ||
""" | ||
Return the string representation of the Discrete node. | ||
Returns: | ||
str: The string representation of the node. | ||
""" | ||
return "Discrete Node with " + str(self._distribution) |