| Type | ||
|---|---|---|
| Name | Type | Values |
| Employee | String | Huey, Dewey, Louie |
| Rule | String | r2, r3, r4, r5, r6 |
| Function | |
|---|---|
| Name | Type |
| age of Employee | Int |
| service years of Employee | Age |
| vacation days of Employee | Int |
| Relation |
|---|
| Name |
| Employee is Student |
| Employee is Veteran |
| Employee is eligible for Rule |
| Employee applies Rule |
| Define the eligibility for rule 2 | ||||
|---|---|---|---|---|
| A | Employee | age of Employee | service years of Employee | Employee is eligible for r2 |
| 1 | - | < 18 | - | Yes |
| 2 | - | ≥ 60 | - | Yes |
| 3 | - | [18, 60) | ≥ 30 | Yes |
| Define the eligibility for rule 3 | ||||
|---|---|---|---|---|
| A | Employee | age of Employee | service years of Employee | Employee is eligible for r3 |
| 1 | - | - | ≥ 30 | Yes |
| 2 | - | < 60 | < 30 | Yes |
| Define the eligibility for rule 4 | ||||
|---|---|---|---|---|
| A | Employee | age of Employee | service years of Employee | Employee is eligible for r4 |
| 1 | - | - | [15, 30) | Yes |
| 2 | - | ≥ 45 | - | Yes |
| Define the eligibility for rule 5 | |||
|---|---|---|---|
| A | Employee | Employee is Student | Employee is eligible for r5 |
| 1 | - | Yes | Yes |
| Define the eligibility for rule 6 | |||
|---|---|---|---|
| A | Employee | Employee is Veteran | Employee is eligible for r6 |
| 1 | - | Yes | Yes |
| Calculate vacation days based on which rules are applied. | |||||||
|---|---|---|---|---|---|---|---|
| C+ | Employee | Employee applies r2 | Employee applies r3 | Employee applies r4 | Employee applies r5 | Employee applies r6 | vacation days of Employee |
| 1 | - | - | - | - | - | - | 22 |
| 2 | - | Yes | - | - | - | - | 5 |
| 3 | - | - | - | - | - | - | 3 |
| 4 | - | No | - | Yes | - | - | 2 |
| 5 | - | - | - | - | Yes | - | 1 |
| 6 | - | - | - | - | - | Yes | 1 |
| Only apply rule if eligible. | ||||
|---|---|---|---|---|
| E* | Employee | Rule | Employee applies Rule | Employee is eligible for Rule |
| 1 | - | - | Yes | Yes |
| Max days. | ||
|---|---|---|
| E* | Employee | vacation days of Employee |
| 1 | - | ≤ 29 |
| Total days. | ||
|---|---|---|
| C+ | Employee | Total Days |
| 1 | - | vacation days of Employee |
| Goal |
|---|
| Maximize Total Days |
| Employee Info | |||||
|---|---|---|---|---|---|
| D | Employee | age of Employee | service years of Employee | Employee is Veteran | Employee is Student |
| 1 | Huey | 17 | 1 | Yes | No |
| 2 | Dewey | 70 | 31 | No | Yes |
| 3 | Louie | 35 | 16 | No | No |