Skip to content

Commit

Permalink
allow the configuration to set the random variables in Simulation call (
Browse files Browse the repository at this point in the history
  • Loading branch information
RHammond2 committed Mar 19, 2024
1 parent 9f8db22 commit 72d717f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wombat/core/simulation_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ class Simulation(FromDictMixin):

def __attrs_post_init__(self) -> None:
"""Post-initialization hook."""
# Check for random seeding from the configuration if none provided directly
if self.random_seed is None:
self.random_seed = self.config.random_seed
if self.random_generator is None:
self.random_generator = self.config.random_generator

# Finish the setup
self._setup_simulation()

@config.validator # type: ignore
Expand Down

0 comments on commit 72d717f

Please sign in to comment.