-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Tijl/ /rc calendar #431
Tijl/ /rc calendar #431
Conversation
- min budget activities - min budget filler activities - max optional budget activities - max optional filler activities are all different batches of activities scheduled in sequence - each with their own budget object(s).
Hey people, The min/max day & week budgets are working fine now!
I'll not have time to code till Friday morning - as going to the office physically consumes the little 'free/coding/ZinZen' hours I have in a day - so feel free to do stuff - if you feel like it. |
After review from @thinkrapido this implementation and the abstractions seems to fit the need.
The approach is to use a main calendar of Vec<Rc>.
Each Hour on the Calendar can be Free or Occupied.
Each Goal (simple or budget) gets translated to one or more Activities by activity_generator.rs.
Each Activity has an internal calendar_overlay of Vec<Option<Weak>>.
This get filtered on Activity creation for any Hour that doesn't fit the Goal constraints.
After that, the activity_placer.rs doesn't know anything about dates/times - it just looks at how many blocks are available, and schedules each Activity in turn, counting conflicts via Rc::weak_count, updating the Calendar, which auto-updates the Activities overlay via the Rc:Weak that get invalidated when an Hour is converted from Free to Occupied.