Project to create a chronological list of randomised tasks. RRS feed

  • Question

  • User-802941640 posted

    What would be the best approach for this mini-project?

    I'll have an object Task and a Year as a collection of Days. Each Day will have one or many Tasks.

    Task will consist of a Name, Schedule (Daily, Weekly, Monthly) and Frequency (x1, x2, x3, x4, x5).
    Eg: Task A is 2x Monthly, Task B is 1x Daily, Task C is 4x Weekly

    I would like to generate a list for a complete year of tasks. Tasks have no set order or dates, and so should just be random. Only obeying the Schedule and Frequency.
    Eg: February can't contain Task A more than twice.

    I'm initially thinking of using Linq to select Tasks on Schedule into separate lists.
    I'd then probably iterate the separate lists to make the extra Tasks from its Frequency.
    Then I'd randomise the list of Tasks.
    Iterate the Year and assign a Task from the random lists for daily, weekly and monthly.

    How does that logic sound?

    Wednesday, February 10, 2016 11:43 PM


  • User614698185 posted

    Hi Ken,

    How does that logic sound?

    According to your description, your task is related to plan and frequency. You could generate these analytical first, then associate with the month and year. So, I think this plan is feasible.

    Best Regards,

    Candice Zhou

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 11, 2016 7:09 AM