Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minimal testcase with multiple runs and seed #14

Open
andsor opened this issue Feb 28, 2016 · 0 comments
Open

Minimal testcase with multiple runs and seed #14

andsor opened this issue Feb 28, 2016 · 0 comments

Comments

@andsor
Copy link
Member

andsor commented Feb 28, 2016

This extends #12. simkernel should supply an individual seed to each run if requested by the user -- by supplying a seed argument to the simulation function (for the individual seed) and a seed argument to the call as the master seed. The library uses the master seed to generate the individual seeds.

from simkernel import Experiment

def sim(seed):
    return seed

xp = Experiment(sim)
# the seed argument is the master seed used to generate the individual seeds
res = xp(repeat=3, seed=42)

# check for uniqueness of return values
assert np.size(res) == 3
np.testing.assert_array_equal(np.sort(res), np.unique(res))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant