-
Notifications
You must be signed in to change notification settings - Fork 928
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
model: Move random seed and random to __init__ (#1940)
* model: Move random seed and random to __init__ Given that `super().__init__()` is now necessary for user's model class `__init__()`, this simplifies the `Model` construct. And `model.random` can be initialized with other RNG objects (`np.random.default_rng(...)`, or any other RNG). Prior discussion #1938 Please enter the commit message for your changes. Lines starting * model: Set seed as keyword argument * make_model: Set seed after model initialization This is because the seed param is no longer always passed by the user to mesa.Model.__init__. * add super call in model.__init__ * attempted debug * Update test_time.py * Update test_time.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Ensure object.__init__ has no other argument * fix: Remove need of __new__ in ModelCreator * Remove obsolete attributes * Remove superfluous code --------- Co-authored-by: Jan Kwakkel <j.h.kwakkel@tudelft.nl> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
ead9cd1
commit 8739099
Showing
4 changed files
with
13 additions
and
19 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
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