dox Executable Documentation

Priority scheduling

Single task

Given the task 'one' in 'root'
When I create the schedule
Then there should be 1 slots in the schedule
Then slot 1 should be task 'one'

Schedule earliest deadline first

Given the task 'one' in 'root'
Given the task 'two' in 'root'
Given the task 'three' in 'root'
Given 'one' has the deadline 'tomorrow'
Given 'two' has the deadline 'yesterday'
Given 'three' has the deadline 'now'
When I create the schedule
Then slot 1 should be task 'two'
Then slot 2 should be task 'three'
Then slot 3 should be task 'one'

Highest priority first

Given the task 'one' in 'root'
Given the task 'two' in 'root'
Given the task 'three' in 'root'
Given 'one' has the priority 3
Given 'two' has the priority 1
Given 'three' has the priority 2
When I create the schedule
Then slot 1 should be task 'two'
Then slot 2 should be task 'three'
Then slot 3 should be task 'one'

Priorities over deadlines

Given the task 'one' in 'root'
Given the task 'two' in 'root'
Given the task 'three' in 'root'
Given the task 'four' in 'root'
Given 'one' has the priority 2
Given 'two' has the priority 1
Given 'three' has the priority 3
Given 'four' has the priority 2
Given 'one' has the deadline 'tomorrow'
Given 'two' has the deadline 'yesterday'
Given 'three' has the deadline 'now'
Given 'four' has the deadline 'now'
When I create the schedule
Then slot 1 should be task 'two'
Then slot 2 should be task 'four'
Then slot 3 should be task 'one'
Then slot 4 should be task 'three'

Cascading priorities

Given the task 'a' in 'root'
Given the task 'b' in 'root'
Given the task 'c' in 'root'
Given the task 'aa' in 'a'
Given the task 'ab' in 'a'
Given the task 'ba' in 'b'
Given the task 'ca' in 'c'
Given 'a' has the priority 3
Given 'b' has the priority 1
Given 'c' has the priority 2
Given 'a' has the deadline 'now'
Given 'b' has the deadline 'tomorrow'
Given 'c' has the deadline 'yesterday'
Given 'aa' has the deadline 'now'
Given 'ab' has the deadline 'yesterday'
When I create the schedule
Then there should be 4 slots in the schedule
Then slot 1 should be task 'ba'
Then slot 2 should be task 'ca'
Then slot 3 should be task 'ab'
Then slot 4 should be task 'aa'

Earliest deadline of children

Given the task 'a' in 'root'
Given the task 'b' in 'root'
Given the task 'c' in 'root'
Given the task 'aa' in 'a'
Given the task 'bb' in 'b'
Given the task 'cc' in 'c'
Given 'a' has the priority 1
Given 'b' has the priority 2
Given 'c' has the priority 1
Given 'aa' has the deadline 'tomorrow'
Given 'bb' has the deadline 'now'
Given 'cc' has the deadline 'now'
When I create the schedule
Then there should be 3 slots in the schedule
Then slot 1 should be task 'cc'
Then slot 2 should be task 'aa'
Then slot 3 should be task 'bb'

Multiple cascades

Given the task 'a' in 'root'
Given the task 'b' in 'root'
Given the task 'aa' in 'a'
Given the task 'ab' in 'a'
Given the task 'ac' in 'a'
Given the task 'ad' in 'a'
Given the task 'ba' in 'b'
Given the task 'bb' in 'b'
Given the task 'aca' in 'ac'
Given the task 'acb' in 'ac'
Given the task 'aba' in 'ab'
Given 'a' has the priority 2
Given 'b' has the priority 1
Given 'aa' has the priority 2
Given 'ad' has the priority 1
Given 'bb' has the priority 4
Given 'aa' has the deadline 'now'
Given 'ab' has the deadline 'yesterday'
Given 'ac' has the deadline 'now'
Given 'ad' has the deadline 'tomorrow'
When I create the schedule
Then there should be 7 slots in the schedule
Then slot 1 should be task 'bb'
Then slot 2 should be task 'ba'
Then slot 3 should be task 'ad'
Then slot 4 should be task 'aa'
Then slot 5 should be task 'aba'
Then slot 6 should be task 'aca'
Then slot 7 should be task 'acb'

Unschedulable task

Given the task 'a' in 'root'
Given the task 'b' in 'root'
Given 'a' has the priority 1
Given 'a' has the priority 2
Given 'a' depends on 'b'
When I create the schedule
Then there should be 2 slots in the schedule
Then slot 1 should be task 'b'
Then slot 2 should be task 'a'