By: CS2103 W15-4
Since: Feb 2019
Licence: MIT
MINDEF Duty Planner is a platform to assist military units in the SAF in the assignment of daily duties amongst the servicemen. The application is optimized for those who prefer to work with a Command Line Interface (CLI) while still having the benefits of a Graphical User Interface (GUI). The software is designed to automate the process of fairly assigning duties to available servicemen for an entire month. It also enables servicemen to conveniently indicate the days they are unavailable for duty. It seeks to fairly distribute duties by taking into account the varying importance of each duty (e.g. Sunday duties are worth more than weekday duties).
-
Ensure you have Java version
9
or later installed in your Computer. -
Log in into the system as an admin or a general user. NRIC corresponds to the username. Both the NRIC and the password are case-sensitive.
-
For admin account: NRIC is Admin, password is Admin
-
For general account: NRIC is the user’s NRIC, password is NRIC by default which can be changed.
-
-
Type the command in the command box and press Enter to execute it.
e.g. typinghelp
and pressing Enter will open the help window. -
Some example commands you can try:
-
list
: lists all contacts -
add
n/John Doe nr/S9012345N p/98765432 c/Echo s/2 r/CFC t/injured
: adds a personnel namedJohn Doe
to the Personnel Database. -
delete
3
: deletes the 3rd contact shown in the current list -
exit
: exits the app
-
-
Refer to Section 3, “User Features” for details of each command.
-
Some commands can only be accessed by Admin type accounts and some by General type accounts.
-
For Practical Exam: You may use an administrator account with Username: Admin, and Password: Admin
-
For Practical Exam: In personnel list, the password of the users will be listed for your convenience.
-
If you close the login window, you are still able to view the personnel list and the calendar duty list. However, you will not be able to use any commands.
Logs user into account
NRIC and passwords are case-sensitive.
Enter in NRIC and password into the top and bottom text areas respectively, press enter.
-
Can only be done in the login box at the start of the program.
-
By default, if your password has not been changed by you or an Admin, the password is your NRIC.
-
Contact an administrator if you have trouble logging in.
-
If you need to change your account, exit the program, then log back into a different account.
-
There are 2 types of accounts: General type accounts, and Admin (or Administrator) type accounts.
-
Admin accounts have access to more commands, or more functionalities for some kind of commands.
Command Format
-
Words in
UPPER_CASE
are the parameters to be supplied by the user e.g. inlogin nr/NRIC
,NRIC
is a parameter which can be used asadd n/S01234567Z
. -
Items in square brackets are optional e.g
n/NAME [t/TAG]
can be used asn/John Doe t/friend
or asn/John Doe
. -
Items with
…
after them can be used multiple times including zero times e.g.[t/TAG]…
can be used ast/friend
,t/friend t/family
etc. -
Parameters can be in any order e.g. if the command specifies
n/NAME p/PHONE_NUMBER
,p/PHONE_NUMBER n/NAME
is also acceptable. -
An Admin and a User may have different formats for the same command
The user can see their details about their own duties assigned to them and their upcoming duties ranked by recency.
Format: view
The user can see their details about their own duties assigned to other users.
Format: view NRIC
Example:
-
view S9012345L
The user can see the full duty rosters for particular months.
Format: roster MONTH
Example:
-
roster February
The user can block dates and set which dates they are unavailable to duties for upcoming months. A user can block up to 15 days per month.
Format: block MONTH DAY DAY DAY …
Example:
-
block March 3 6 15 21 30
The user can view the dates they have blocked for a particular month.
Format: block MONTH
Example:
-
block March
The user can request for a duty swap with another user. This will be subject to the agreement of the other user and approval of the admin (i.e. commander).
The other user and admin will be notified upon login and they will be prompted to accept or decline the request.
Format: `swap ad/CURRENTDUTYDATE rd/DESIREDDUTYDATE
Example:
-
swap ad/14022019 rd/21022019 t/Please help a bro out!
Finds persons whose names contain any of the given keywords.
Format: find KEYWORD [MORE_KEYWORDS]
-
The search is case insensitive. e.g
hans
will matchHans
-
The order of the keywords does not matter. e.g.
Hans Bo
will matchBo Hans
-
Only the name is searched.
-
Only full words will be matched e.g.
Han
will not matchHans
-
Persons matching at least one keyword will be returned (i.e.
OR
search). e.g.Hans Bo
will returnHans Gruber
,Bo Yang
Examples:
-
find John
Returnsjohn
andJohn Doe
-
find Betsy Tim John
Returns any person having namesBetsy
,Tim
, orJohn
Lists all the commands that you have entered in reverse chronological order.
Format: history
ℹ️
|
Pressing the ↑ and ↓ arrows will display the previous and next input respectively in the command box. |
Restores the address book to the state before the previous undoable command was executed.
Format: undo
ℹ️
|
Undoable commands: those commands that modify the address book’s content ( |
Examples:
-
delete 1
list
undo
(reverses thedelete 1
command) -
select 1
list
undo
Theundo
command fails as there are no undoable commands executed previously. -
delete 1
clear
undo
(reverses theclear
command)
undo
(reverses thedelete 1
command)
Reverses the most recent undo
command.
Format: redo
Examples:
-
delete 1
undo
(reverses thedelete 1
command)
redo
(reapplies thedelete 1
command) -
delete 1
redo
Theredo
command fails as there are noundo
commands executed previously. -
delete 1
clear
undo
(reverses theclear
command)
undo
(reverses thedelete 1
command)
redo
(reapplies thedelete 1
command)
redo
(reapplies theclear
command)
Edits user’s own details. Can edit one or more fields.
Format: edit INDEX [c/COMPANY] [s/SECTION] [r/RANK] [n/NAME] [p/PHONE] [t/TAG] [pw/PASSWORD]
-
At least one of the optional fields must be provided.
-
Existing values will be updated to the input values.
-
When editing tags, the existing tags of the person will be removed i.e adding of tags is not cumulative.
-
You can remove all the person’s tags by typing
t/
without specifying any tags after it.
Examples:
-
edit p/84523546 r/CPL
and
Edits the phone number and rank of the user to be `84523546CPL
respectively. -
edit c/Hotel t/ pw/pass
Edits the company of the user to beHotel
, clears all existing tags, and changes password to 'pass'.
Add a user to the system with the corresponding NRIC, password, company, section, rank, name and contact number.
Format: add nr/NRIC c/COMPANY s/SECTION r/RANK n/NAME p/PHONE [t/TAG]
-
By default, the user will be a General type account, and the password will be the NRIC.
-
Password and account type can be changed using the
edit
command.
Deletes the specified person from the duty planner.
Format: delete INDEX
-
Deletes the person at the specified
INDEX
. -
The index refers to the index number shown in the displayed person list.
-
The index must be a positive integer 1, 2, 3, …
Examples:
-
list
delete 2
Deletes the 2nd person in the duty planner personnel list. -
find Betsy
delete 1
Deletes the 1st person in the results of thefind
command.
Edits an existing user’s details in the personnel list.
Format: edit INDEX [nr/NRIC] [c/COMPANY] [s/SECTION] [r/RANK] [n/NAME] [p/PHONE] [t/TAG] [pw/PASSWORD] [u/A or G]
-
Edits the person at the specified
INDEX
. The index refers to the index number shown in the displayed person list. The index must be a positive integer 1, 2, 3, … -
At least one of the optional fields must be provided.
-
Existing values will be updated to the input values.
-
When editing tags, the existing tags of the person will be removed i.e adding of tags is not cumulative.
-
You can remove all the person’s tags by typing
t/
without specifying any tags after it. -
For account type field specified by
u/
, A corresponds to an Admin account, G corresponds to a general account.
Examples:
-
edit 2 p/84523546 r/CPL u/A
Edits the phone number and rank of the 2nd person to be84523546
andCPL
respectively, and grants the person’s account administrator privileges. -
edit 1 c/Hotel t/ pw/pass
Edits the company of the 1st person to beHotel
, clears all existing tags, and changes passworrd to 'pass'.
This command invokes the scheduling algorithm for the upcoming month. It generates a viable duty schedule roster where each duty slot for the upcoming month will be filled by the people currently in the database. ++
-
We introduce a point system to each individual such that a servivemen can earn points by doing duties. The points awarded to servicemen are cumulative, thus the points awarded are carried over to the next month.
-
Each duty is worth a certain number of points and a person gains that amount of points by doing that duty. For example, if all Sunday duties are worth 4 points, a servicemen who is assigned a Sunday duty will by awarded 4 points.
-
Before the scheduling command is called, each person has the opportunity to indicate the days in which they are unavailable to do duty. (See 3.9 block command)
The algorithm is optimized such that persons with low points will be allocated to duties with high points. It automatically attempts to balance out the points of each person by the end of the month.
The duty schedule generated by the schedule command is not deterministic, calling schedule command multiple times generates different duty allocation.
Calling the schedule command merely generates a viable shedule, but does not finalize the schedule (i.e. points awarded to each person is yet to be added). Schedule generated is also not deterministic, calling schedule command multiple times generates different duty allocation. Thus, the admin can call schedule command continuously until a satisfactory schedule is produced. To finalize the schedule, use the confirm command. (See 4.8 confirm schedule)
Format: schedule
Q: What if I want to swap my duty with another person?
A: Use "swap" command to request a swap. If you receive no updates about it, contact your administrator.
Q: What is the main feature of this app?
A: The main feature is the automated scheduling algorithm, which significantly minimizes the amount of work that the admin has to do.
Q: What is my username and password?
A: Your username is by default your NRIC, used so prevalently in the SAF.
Your password is also your NRIC by default, unless you or your administrator changed it. you can use the 'edit' command to edit your password later on.
Q: What if I forgot my password?
A: Contact your administrator for help.
Q: What should I do if I need help with the app?
A: You can enter 'help' in the command line, or press Help > Help, or simply press F1. This will open up the User Guide in a new window.
-
Viewing help :
help
-
Viewing own duties :
view
-
Viewing other’s duties :
view NRIC
-
Blocking dates :
block d/date d/date d/date …
-
Make swap request :
swap
-
List all the users :
list
-
Locate person by name :
find
-
List entered commands :
history
-
Undo command :
undo
-
Redo command :
redo
-
Exit :
exit
-
Edit own info :
edit [c/COMPANY] [s/SECTION] [r/RANK] [n/NAME] [p/PHONE] [t/TAG] [pw/PASSWORD]
-
Add a user :
add nr/NRIC c/COMPANY s/SECTION r/RANK n/NAME p/PHONE [t/TAG]
-
Edit any user :
edit INDEX [nr/NRIC] [c/COMPANY] [s/SECTION] [r/RANK] [n/NAME] [p/PHONE] [t/TAG] [pw/PASSWORD] [u/A or G]
-
Delete a user :
delete INDEX
-
Scheduling duties :
schedule
-
Confirm schedule :
confirm
-
Clear entries :
clear