PROJECT: Easy Travel
The purpose of this document is to document my contribution I have made to the project.
Easy Travel Github link: https://ay1920s2-cs2103t-w17-3.github.io/main/
Overview
Easy Travel is a desktop travel planning application done by me and 4 other software engineering students for students who are planning for an overseas trip.
Easy Travel helps to reduce the amount of stress when planning for a trip by providing 5 main list: activity, transport booking, accommodation booking, packing list and fixed expense.
Easy Travel has a GUI created with JavaFX and user can interact with it through a CLI (Command Line Interface). It is written in Java and has about 10 kLoC
Summary of contributions
-
Major enhancement: Implemented Accommodation Booking Tab and commands
-
What it does: The accommodation booking feature allows the user to keep track of all the accommodation bookings made before a trip. User can input details of the accommodation as well as the start and end day of the booking.
-
Justification: This feature is useful in allowing users to keep track of the accommodations they have booked.
-
Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands.
-
-
Minor enhancement: Find overlaps in accommodation bookings
-
What it does: Prevent users from entering multiple accommodation bookings that overlaps one another.
-
Justification: To prevent users from booking overlapping accommodations or to prevent them from recording an accommodation that overlaps with other accommodations.
-
-
Minor enhancement: Status check for missing accommodation days
-
What it does: List down to the user the days that has missing accommodations.
-
Justification: To give users an idea of the days that are missing accommodations so they can book it before going on the trip.
-
-
Code contributed: [All commits] [Project Code Dashboard]
-
Other contributions:
-
Enhancements to existing features:
-
Wrote test for existing feature to improve coverage
-
-
Documentation:
-
Contributed to the User Guide and Developer Guide for this project. See below for more details.
-
-
Community:
-
Over 30 Pull Requests on Github
-
-
Contributions to the User Guide
Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users. |
Accommodation Booking
(Contributed by Joshua Wee)
Accommodation is something you can miss out on planning and this feature is for you to plan for your accommodation and record them down. You can record the following information about your accommodation bookings:
-
Name of the accommodation
-
The location or address
-
The first day when you check-in
-
The last day when you check-out
-
Remarks you want to note for an accommodation booking
Accommodation Booking Management Command Parameters
Before you jump right into using this feature, you may want to learn about all the common command parameters used in this feature. The table below shows the list of common command parameters that will be used for this feature.
Parameter Name | Description |
---|---|
|
The name of the accommodation booking It must be alphanumeric words not more than 50 characters long. E.g. |
|
The location or address of the accommodation booking It must be alphanumeric words not more than 50 characters long. E.g. |
|
The first day of the accommodation booking, in terms of the day index. It must be a valid day index number. The day index number represents the number of days from the first day of your trip. The first day of your trip is index |
|
The last day of the accommodation booking, in terms of the day index. It must be a valid day index number. The day index number represents the number of days from the first day of your trip. The first day of your trip is index |
|
The remark you want to note for your accommodation booking. It must not be more than 150 characters (punctuations allowed) long. E.g. |
|
The index number of the accommodation booking in the displayed list. The first entry of the list has an index number of It must be a valid index number. |
List all accommodation bookings: listacc
You can use this command to navigate to the Accommodation Tab and display all your activities in E.T..
Format:
listacc
Example: If you are in another tab and wish to look at your list of accommodation bookings, you can follow these instructions.
Add a new accommodation booking: addacc
This command would add a new accommodation booking into your list of accommodations.
Format:
addacc name/NAME loc/LOCATION startday/START_DAY endday/END_DAY [remark/REMARK]
Refer to Accommodation Booking Management Command Parameters for more detail about each parameter. |
Examples:
Let’s say you have secured a booking of the accommodation with the following details. You can follow the following steps to record this into your list of accommodations.
Name |
JW Marriott Hotel |
Location |
KL |
Start Day |
2 |
End Day |
3 |
addacc
commandEdit an existing accommodation booking: editacc
This command will edit any mistakes made in the details of the accommodation booking using the specified INDEX
.
Format: editacc INDEX [name/NAME] [loc/LOCATION] [startday/START_DAY] [endday/END_DAY] [remark/REMARK]
Refer to Accommodation Booking Management Command Parameters for more detail about each parameter. |
Examples:
Let’s say you decided to change the second accommodation booking to check in on day 4 and check out on day 6.
editacc
commandDelete an existing accommodation booking: deleteacc
This command would delete the accommodation booking you have added earlier using the specified INDEX
Format:
deleteacc INDEX
Refer to Accommodation Booking Management Command Parameters for more detail about the parameter. |
Examples:
Let’s say you decided to cancel on the accommodation booking that you have made earlier. The accommodation booking that you want to cancel is stored at INDEX
2 of E.T. , running the following command would delete the accommodation booking entry.
Sort the accommodation booking list: sortacc
You can use this command to sort the displayed list of accommodation bookings.
Format:
sortacc CRITERIA ORDER
|
Example:
If you want to sort your list of accommodation bookings in ascending order of name, to help you in your planning, you can do the following.
Clear all accommodation bookings: clearacc
This command allows you to clear all accommodation bookings you have made previously.
Format:
clearacc
Example:
Let’s say you decided to delete all accommodation bookings you have created without deleting the trip. Running this command would clear all prior accommodation booking created and let you start on a clean slate.
Contributions to the Developer Guide
Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project. |
Accommodation Booking Manager
(Contributed by Joshua Wee)
E.T. allows the user to keep track of their accommodation bookings for his/her trip. The accommodation booking manager is one of the ListManager
s (See [List-Manager]). On top of the basic operations provided by a ListManager
, it also prevents the user from having overlapping accommodation bookings.
Rationale
The transport booking manager is an important feature to have because any oversea trip of more than one day will require some form of accommodation. Thus, we decided to create an accommodation booking manager as one of the ListManager
s.
Current Implementation
When a user adds an accommodation booking, the Logic
Component parses the user input and creates an AddAccommodationBookingCommand
object (See [Design-Logic]). When the execute()
method of AddAccommodationBookingCommand
is called, the execution will check if the new accommodation booking overlaps with any other other current bookings.
Using a Java’s stream, the new accommodation booking will be checked against all other bookings in the list to look for any overlaps. We used an interval overlap detection algorithm to check for overlap between 2 accommodation bookings. If the total duration of the 2 accommodation bookings is within the acceptable duration of the algorithm, then there is no overlap. acceptable duration = latest end day - earliest start day
The following diagram gives a visual explanation on this interval overlap detection algorithm.
The following steps describe the flow of an overlap check between 2 accommodation bookings:
-
The start day and end day of both bookings are retrieved using
getStartDay()
andgetEndDay()
methods of theAccommodationBooking
object. -
The total duration of both accommodation bookings is calculated.
-
The latest end day and earliest start day is obtained.
-
The acceptable duration is calculated.
-
If the acceptable duration is greater than the total duration of both bookings, there is no overlap. The overlap check will continue for the next accommodation booking until the last. If there is an overlap, the check will stop and the user will receive a message that informs them that the new accommodation booking will overlap with another booking.
The Activity Diagram below summaries the above steps.
Design Consideration
Aspect: Calculating overlap of the new accommodation booking with the other accommodation bookings in the list
Pros |
Cons |
|
Option 1 (Current) In the worst case, the checking for overlap against all accommodation booking takes O(n) time where n is the number of accommodation bookings |
Simple and easy to implement. Only require constant space to calculate overlaps between 2 intervals. |
Requires some calculation. |
Option 2 In the worst case, the checking for overlap against all accommodation booking takes O(d) time where d is the number of days. |
Simple and easy to implement. Checking for any particular day takes constant time. |
Require a large amount of storage space to save the hashtable data. |
Reason for choosing option 1:
-
Both options are simple and easy to implement. However, option 2 has a larger overhead due to the hashtable it uses. Thus, we decided option 1 is better.