-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): Parse dates correctly, including syntax sugar
Note that most of the parsing code here is extracted from the 2023/08/20 POC.
- Loading branch information
Showing
7 changed files
with
204 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
,2,3,4,5,6,7,8 | ||
,Sat,Sun,Mon,Tue,Wed,Thu,Fri | ||
Nurse 0,N,,N,,N,E, | ||
Nurse 1,,,E,N,D,,N | ||
Nurse 2,E,E,,D,,N,D | ||
Nurse 3,,D,D,E,,D, | ||
Nurse 4,D,N,,,E,,E |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
apiVersion: alpha | ||
description: OR-Tools Example 2 with shift requests. From <https://developers.google.com/optimization/scheduling/employee_scheduling>. | ||
startdate: 2023-09-02 | ||
enddate: 2023-09-08 | ||
people: | ||
- description: Nurse 0 | ||
- description: Nurse 1 | ||
- description: Nurse 2 | ||
- description: Nurse 3 | ||
- description: Nurse 4 | ||
requirements: | ||
- id: D | ||
description: Day shift requirement | ||
required_people: 1 | ||
- id: E | ||
description: Evening shift requirement | ||
required_people: 1 | ||
- id: N | ||
description: Night shift requirement | ||
required_people: 1 | ||
preferences: | ||
- type: all requirements fulfilled | ||
- type: all people work at most one shift per day | ||
- type: assign shifts evenly | ||
# Person 0 | ||
- type: shift request | ||
person: 0 | ||
day: [2, 6, 8] | ||
shift: N | ||
- type: shift request | ||
person: 0 | ||
day: 7 | ||
shift: E | ||
# Person 1 | ||
- type: shift request | ||
person: 1 | ||
day: 6 | ||
shift: D | ||
- type: shift request | ||
person: 1 | ||
day: [4, 5] | ||
shift: E | ||
- type: shift request | ||
person: 1 | ||
day: 8 | ||
shift: N | ||
# Person 2 | ||
- type: shift request | ||
person: 2 | ||
day: 5 | ||
shift: D | ||
- type: shift request | ||
person: 2 | ||
day: [2, 3, 7] | ||
shift: E | ||
# Person 3 | ||
- type: shift request | ||
person: 3 | ||
day: [4, 7] | ||
shift: D | ||
- type: shift request | ||
person: 3 | ||
day: 5 | ||
shift: E | ||
- type: shift request | ||
person: 3 | ||
day: 2 | ||
shift: N | ||
# Person 4 | ||
- type: shift request | ||
person: 4 | ||
day: 6 | ||
shift: D | ||
- type: shift request | ||
person: 4 | ||
day: [4, 7] | ||
shift: E | ||
- type: shift request | ||
person: 4 | ||
day: 3 | ||
shift: N |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
,2,3,4,5,6,7,8 | ||
,Sat,Sun,Mon,Tue,Wed,Thu,Fri | ||
Nurse 0,N,,N,,N,E, | ||
Nurse 1,,,E,N,D,,N | ||
Nurse 2,E,E,,D,,N,D | ||
Nurse 3,,D,D,E,,D, | ||
Nurse 4,D,N,,,E,,E |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
apiVersion: alpha | ||
description: OR-Tools Example 2 with shift requests. From <https://developers.google.com/optimization/scheduling/employee_scheduling>. | ||
startdate: 2023-09-02 | ||
enddate: 2023-09-08 | ||
people: | ||
- description: Nurse 0 | ||
- description: Nurse 1 | ||
- description: Nurse 2 | ||
- description: Nurse 3 | ||
- description: Nurse 4 | ||
requirements: | ||
- id: D | ||
description: Day shift requirement | ||
required_people: 1 | ||
- id: E | ||
description: Evening shift requirement | ||
required_people: 1 | ||
- id: N | ||
description: Night shift requirement | ||
required_people: 1 | ||
preferences: | ||
- type: all requirements fulfilled | ||
- type: all people work at most one shift per day | ||
- type: assign shifts evenly | ||
# Person 0 | ||
- type: shift request | ||
person: 0 | ||
day: [2023-09-02, 2023-09-06, 2023-09-08] | ||
shift: N | ||
- type: shift request | ||
person: 0 | ||
day: 2023-09-07 | ||
shift: E | ||
# Person 1 | ||
- type: shift request | ||
person: 1 | ||
day: 2023-09-06 | ||
shift: D | ||
- type: shift request | ||
person: 1 | ||
day: [2023-09-04, 2023-09-05] | ||
shift: E | ||
- type: shift request | ||
person: 1 | ||
day: 2023-09-08 | ||
shift: N | ||
# Person 2 | ||
- type: shift request | ||
person: 2 | ||
day: 09-05 | ||
shift: D | ||
- type: shift request | ||
person: 2 | ||
day: [09-02, 09-03, 09-07] | ||
shift: E | ||
# Person 3 | ||
- type: shift request | ||
person: 3 | ||
day: [09-04, 09-07] | ||
shift: D | ||
- type: shift request | ||
person: 3 | ||
day: 09-05 | ||
shift: E | ||
- type: shift request | ||
person: 3 | ||
day: 09-02 | ||
shift: N | ||
# Person 4 | ||
- type: shift request | ||
person: 4 | ||
day: 6 | ||
shift: D | ||
- type: shift request | ||
person: 4 | ||
day: [4, 7] | ||
shift: E | ||
- type: shift request | ||
person: 4 | ||
day: 3 | ||
shift: N |