Skip to content

DefaultDailyTimerGenerator and WorkHoursTimerGenerator behave differently #159

@sshu2017

Description

@sshu2017

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions