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

add test filler-goal #434

Closed
wants to merge 33 commits into from
Closed

add test filler-goal #434

wants to merge 33 commits into from

Conversation

tijlleenders
Copy link
Owner

Test for filler-goal.

The idea is that when you have a big one-time thing of several hours - you might put a reservation of X hours on the calendar.
Then as you think of more things - you add subGoals that can be independently achieved. If there is time left over in the parent goal after the specific subGoals have been achieved - that time also gets reserved on the calendar.

Another example would be a vacation day - where you have a few things you want to do - so you make specific subGoals for that - but the rest of the day is left open - but you still want the rest scheduled on the calendar as 'vacation day'.

@tijlleenders
Copy link
Owner Author

@kobe-reygel @thinkrapido Another failing test case someone can pick up.

@thinkrapido
Copy link
Collaborator

done by #447

@tijlleenders
Copy link
Owner Author

@thinkrapido
I'm sorry - I didn't provide enough detail to make it clear what is required to solve this issue. Thanks for the work and solution provided. I'll see if I can build on that.

@moaz-mokhtar
Copy link
Collaborator

Hello @kobe-reygel @thinkrapido

I hope you are doing well.

I will work on this

@moaz-mokhtar
Copy link
Collaborator

I want make sure that I understand the issue to be resolved.

  • I did run tests on branch tijl/-/add-filler-goal-test and found that filler-goal failed which showing different results from expected.
  • What I understand that here we want to allow sub goal which exceed parent goal's deadline to be reserved in the calendar.
  • I found PR Rom/434/add filler goal test #447 which seems related to filler-goal itself, I think I need to create new test case for this PR specifically if I'm not wrong!!!

@tijlleenders
Copy link
Owner Author

@moaz-mokhtar Why do you think the subGoal needs to go beyond the parent goal's deadline?

The subGoal is >>part of work Goal<< and as such the Activity it generates:

  • should at least satisfy the time conatrainta of the parent.
  • should be linked to the Budget which is also related to the Activity 'Work' generated by the parent Goal.

@moaz-mokhtar
Copy link
Collaborator

I did debug yesterday and would like to share below information.

  • Both tests stable/default-budgets and stable/filler-goal doesn't generate tasks which have children in addition it is not validating that child is valid. But stable/default-budgets success because it is adjusted. I think it should generate task with Daily habits if I'm not wrong.

  • I'm proposing a long-term solution to be applied when convenient. It is for set of rules that validating input goals:

    • System will not proceed when input goals not validated and will return error with related information
    • The start and deadline of a child's goal should not fall outside the start and deadline of its parent goal.
    • The budgeting budget_config of a child's goal should not fall outside the budgeting of its parent goal.
    • The filtering Filters of a child's goal should not fall outside the filtering of its parent goal.
    • The min_duration of a child's goal should not fall outside the duration, budgeting, or filtering of its parent goal.
    • Parent goal shouldn't allow child goal/s to take more duration that causing other child goals to fall outside it.
  • Happy scenario solution which I will work on it is will consider input validated and child goals fall inside the parent's goal

  • My proposal is:

    • pass parent_goal information when generating activities to adjust based on that as below algorithm:
    // goal.rs:42
    pub fn get_adj_start_deadline(&self, calendar: &Calendar, parent_goal: Option<Goal>) -> (NaiveDateTime, NaiveDateTime) {
    // if parent_goal.is_some -> means it is child goal, so do below:
    // adjust generated goals with respect to parent_goal timing constraints
    • For this stage it will be simple which will not apply previous validation for input goals.

@tijlleenders
Copy link
Owner Author

@moaz-mokhtar Please focus comments in this PR solely on the filler-goal test case.
If you think there is something wrong / to be improved in other test cases - please make a separate issue for that. Otherwise it will become very confusing very fast.

All I'm asking in this PR is a passing test case based on correctly generated Activities and output Tasks - while keeping input Goals immutable.

@moaz-mokhtar moaz-mokhtar mentioned this pull request Mar 2, 2024
4 tasks
@tijlleenders
Copy link
Owner Author

@moaz-mokhtar There have been some improvements to main while this PR was outstanding.
Please resolve the merge conflicts, respecting the improvements in main.

@tijlleenders
Copy link
Owner Author

@moaz-mokhtar I think I merged correctly - but that resulted in the tests failing.
Please double-check and investigate.

src/lib.rs Outdated Show resolved Hide resolved
@tijlleenders
Copy link
Owner Author

tijlleenders commented Mar 20, 2024

The approach of adjusting Activities is convoluted and hard to follow. It' better to generate filler Activities as a separate step.

Placing in two separate steps is also not desired, as it implicitly says Budget Activities are less important than simple Goal Activities - and they can't interact with each other to optimize placing.

@tijlleenders tijlleenders deleted the tijl/-/add-filler-goal-test branch March 21, 2024 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants