PROJECT: Easy Travel

The purpose of this document is to document my contribution I have made to the project.

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:

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

NAME

The name of the accommodation booking

It must be alphanumeric words not more than 50 characters long.

E.g. Ritz Carlton

LOCATION

The location or address of the accommodation booking

It must be alphanumeric words not more than 50 characters long.

E.g. KL

START_DAY

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 1, the second day is index 2 and so on, until the last day.
It must be later than END_DAY.

END_DAY

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 1, the second day is index 2 and so on, until the last day. It must be later than START_DAY

REMARK

The remark you want to note for your accommodation booking.

It must not be more than 150 characters (punctuations allowed) long.

E.g. Remember to check-in before 3pm!

INDEX

The index number of the accommodation booking in the displayed list. The first entry of the list has an index number of 1 and all the entries are listed in increasing index numbers.

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.

Listing all your activities:

  1. Type listacc into the Command Box.

  2. Press Enter to execute.

Outcome:

  1. The Result Display will show a success message.

  2. E.T. will switch to the Accommodation Tab.

  3. You can now see all your accommodation bookings.

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

Adding the above accommodation booking:

  1. Type addacc name/JW Marriott Hotel loc/KL startday/2 endday/4 into the Command Box.

  2. Press Enter to execute.

Outcome:

  1. The Result Display will show a success message.

  2. E.T. will switch to the Accommodation Tab.

  3. You can now see all your accommodation bookings including the newly added accommodation booking.

AddAccommodationBooking
Figure 1. After addacc command

Edit 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.

Editing the accommodation booking:

  1. Type editacc 2 startday/4 endday/6 into the Command Box.

  2. Press Enter to execute.

Outcome:

  1. The Result Display will show a success message.

  2. E.T. will switch to the Accommodation Tab.

  3. You can now see all your accommodation bookings including the edited accommodation booking.

EditAccommodationBooking
Figure 2. After editacc command

Delete 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.

Deleting the activity:

  1. Type deleteactivity 1 into the Command Box.

  2. Press Enter to execute.

Outcome:

  1. The Result Display will show a success message.

  2. *E.T. *will switch to the Accommodation Tab.

  3. You can now see that the deleted accommodation booking no longer exists.

Sort the accommodation booking list: sortacc

You can use this command to sort the displayed list of accommodation bookings.

Format:

sortacc CRITERIA ORDER

CRITERIA refers to the criteria to sort the list of accommodation bookings by. It can take the following values: name, location, day.

ORDER refers to the order to sort the list of accommodation bookings by. It can take the value of ascending or asc to sort in ascending order and descending or des to sort in descending 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.

Sorting activities:

  1. Type sortacc name asc into the Command Box.

  2. Press Enter to execute.

Outcome:

  1. The Result Display will show a success message.

  2. E.T. will switch to the Accommodation Tab.

  3. You can see a list of sorted accommodation bookings being displayed.

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.

Clearing the accommodation booking list:

  1. Type clearacc into the Command Box.

  2. Press Enter to execute.

Outcome:

  1. The Result Display will show a success message.

  2. *E.T. *will switch to the Accommodation Tab.

  3. You can see that the list is now empty.

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 ListManagers (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 ListManagers.

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.

OverlappingIntervalAlgorithm
Figure 3. Visual explanation on the interval overlap detection algorithm

The following steps describe the flow of an overlap check between 2 accommodation bookings:

  1. The start day and end day of both bookings are retrieved using getStartDay() and getEndDay() methods of the AccommodationBooking object.

  2. The total duration of both accommodation bookings is calculated.

  3. The latest end day and earliest start day is obtained.

  4. The acceptable duration is calculated.

  5. 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.

FindOverlapActivityDiagram
Figure 4. Workflow of an overlap check between 2 accommodation bookings

Design Consideration

Aspect: Calculating overlap of the new accommodation booking with the other accommodation bookings in the list

Pros

Cons

Option 1 (Current)
Use an interval overlap detection algorithm.

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
Use a hashtable to store the days that have been accounted for.

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.