class
VirtualDate::Scheduler
- VirtualDate::Scheduler
- Reference
- Object
Overview
A simple, deterministic scheduler for VirtualDate vdates.
This scheduler:
- Generates candidate candidates from
vdate.dueVirtualTimes - Resolves omit-driven shifts via
VirtualDate#resolve - Enforces conflict resolution using
duration,flags,parallel - Reschedules forward on conflicts when possible
Notes:
- This is an “advanced baseline” scheduler; it is intentionally conservative and predictable.
- If you need global optimality (e.g. minimizing total displacement), you would add a second pass or switch to a constraint solver.
Defined in:
virtualdate.crConstructors
Instance Method Summary
-
#build(from : Time, to : Time) : Array(Scheduled)
Produces scheduled vdates in [from, to).
-
#on_in_schedule?(scheduled_vdates : Array(Scheduled), vdate : VirtualDate, time : Time) : Bool
True if
vdateis considered “on” attimein the produced schedule. -
#schedule_candidate(candidate : Candidate, scheduled_vdates : Array(Scheduled), *, horizon : Time) : Scheduled | Nil
Schedules a vdate, resolving conflicts by shifting forward (using vdate.shift when Time::Span), respecting vdate.fixed and max_shift/max_shifts.
- #vdates : Array(VirtualDate)
- #vdates=(vdates : Array(VirtualDate))
Constructor Detail
Instance Method Detail
Produces scheduled vdates in [from, to).
Parameters:
- granularity: how frequently to generate candidates from due rules (defaults to 1 minute)
- max_candidates: safety limit to avoid infinite generation for very broad rules
Returns: Array(Scheduled), sorted by start time.
True if vdate is considered “on” at time in the produced schedule.