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

DefaultDailyTimerGenerator and WorkHoursTimerGenerator behave differently #159

Open
sshu2017 opened this issue Feb 3, 2022 · 0 comments

Comments

@sshu2017
Copy link

sshu2017 commented Feb 3, 2022

When I do this:

story_timer_gen = DefaultDailyTimerGenerator(
            clock=self.clock,
            seed=next(self.seeder)
        )

low_activity = story_timer_gen.activity(n=3, per=pd.Timedelta("1 day"))

the low_activity is an integer. But if I use this:

story_timer_gen = WorkHoursTimerGenerator(
                clock=self.clock,
                seed=next(self.seeder),
                start_hour=8,
                end_hour=17)
    
low_activity = story_timer_gen.activity(n=3, per=pd.Timedelta("1 day")),

the low_activity is an tuple, which cause issue downstream in the

activity_gen = NumpyRandomGenerator(
            method="choice",
            a=[low_activity, medium_activity, high_activity],

            # 20% person_a has low activity, 50% has medium, 30% has high.
            p=[0.2, 0.5, 0.3],
            seed=next(self.seeder)
        )

because a is required to be 1-dimensional.

Well, I looked into it again and I am confused. Need some time to investigate and will update this ticket later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant