-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CS2113-W12-2] FindOurSEP #8
base: master
Are you sure you want to change the base?
Changes from 250 commits
e1ad270
348818f
aac7d97
1fa650f
5d5630c
14b9589
e7266ff
051bb1a
3697b9b
b17b59f
f0cf7e8
840135c
2e20232
5083f45
60b41f6
d0f8fe8
ba4501f
93f21a2
1e51dc6
bf08242
c92eee7
25bbffe
0da562c
17b8b8f
83ef693
14a2723
47276bd
c5ba304
470ee52
1d3b021
4f8c0b7
205c4c0
f033b3c
92152d2
1ab484e
131585b
aa7526b
e542181
0ee0e65
f0b7d45
c9d5a16
fd7f230
64e349d
baa545f
c61453e
5b7ecdb
43db8d6
7583b5f
9aea85f
1fc7d2a
2a7c81b
3cb447a
d413751
6dfeb39
f7221a9
71f5e92
7370cb1
9d57e56
0734bf0
6a5d6da
2930749
54fe49a
76bfbfc
3311f25
305f4dd
cad578b
2266638
64737a0
d74aeb8
ec2aefd
45fbe0a
65784e2
ff0f2b4
65e40c1
f183cf7
07c620f
a212633
86a370c
e6173f6
380a6d1
7520f65
cfa2eb3
5344e16
d2296d0
1092a5f
72bdd35
15a1dac
a6d54e5
0ff5678
4e8f273
c0d3b6b
5a6910b
50d1aa6
30c1f8b
bacc72b
539bebf
52982b6
b3e4cda
9eb20d5
84c7899
a9151b2
b2a2c90
58c8081
84b485f
12d673e
1cbae78
047d3c1
457c20b
60dfe97
2298e85
a01933e
69ed44b
3940984
31872e5
bdd4ae7
1a52460
88df2e8
bb55428
5b01f8e
1a74870
fee9a6c
03148db
9b50602
f0bc2f4
8d696ab
94b2244
1448a12
2dfb024
f790a40
0ddbad5
8f8a75b
3864b3f
e0c113e
c6451a4
ff2214e
e387892
2f575c2
facfbc1
2a77be3
301345b
7e0d590
590a11d
0b814b8
0204e7f
dd82afd
6ffcc4e
040e00b
545c03a
afa2802
b32e352
58b1647
7153ade
e45c67d
5214ee1
67b6bf1
434a022
47928cd
c8a2eaf
e845773
d766704
aeb4b91
1fd9418
a56f642
240f548
2328a81
82f0951
d9d7127
1ed5065
95fd324
ce47c7f
cb95dd5
a33132c
dacd338
61be5a8
8f830c1
0484f6e
0638254
7ace8a4
9a1d6a2
1279967
9022afa
a300e08
61ed33c
36efa27
648e9d1
8abddad
76baa7e
09fda35
32f08ab
6759560
be2538d
92a7ba0
c5b3d51
610b035
5195a68
de7ecb9
d36f9e1
69efab7
6d3a4dc
5591400
955e1d1
413fa21
5f9d345
ebe7c12
f8a4a20
9c28c39
eacb4c1
6038410
1ed3ac2
ed83d8b
c048ad8
78ac0bd
78101b0
2dc8cc7
dcc46d2
2d2060d
d421e7e
ab4f94e
3bcf660
59da8f1
9a49642
88d4050
8a18329
4b90b35
75a306d
5a1d007
a5e0693
8d23bdb
b0c6599
3cdc700
7ffa6b7
cc0605d
2f78a49
7684ca5
d2789cd
de07cfd
57d3955
7bea33a
4329221
bf0550f
82b8aaa
3e38cb5
a704ced
90ca528
de1d5f8
40535f8
65a8760
d5de08f
e13502c
7e2c9b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"students" : [ ] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
id/A1234567I, gpa/5.0, p/[12, 61, 43], alloc/12 | ||
id/A1234567J, gpa/4.5, p/[1, 2, 3], alloc/1 | ||
id/A1357913L, gpa/4.0, p/[3, 1, 2], alloc/3 | ||
id/A7654321K, gpa/3.8, p/[2, 3, 1], alloc/2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# About us | ||
# About Us | ||
|
||
Display | Name | Github Profile | Portfolio | ||
--------|:----:|:--------------:|:---------: | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Doe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Joe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Ron John | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | John Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) | ||
Display | Name | Github Profile | Portfolio | ||
--------|:-----:|:--------------:|:---------: | ||
![](https://via.placeholder.com/100.png?text=Photo) | Anderson Lim | [Github](https://github.com/Holy-An) | ||
![](https://avatars.githubusercontent.com/u/141603285?s=400&u=bf5b9eb5fde9c6bd5ab3f007f24ca6db6e24870b&v=4) | Isaac | [Github](https://github.com/isaacsaw25) | [Isaac](./team/isaacsaw25) | ||
![](https://picsum.photos/seed/picsum/200/300) | Lee Hao Zhe | [Github](https://github.com/ehz0ah) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Paul Tham | [Github](https://github.com/paulktham) | ||
![](https://via.placeholder.com/100.png?text=Photo) | Xiong Xinzhuang | [Github](https://github.com/ThisisXXZ) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,266 @@ | ||
# Developer Guide | ||
|
||
## Table of Contents | ||
- [Acknowledgements](#Acknowledgements) | ||
- [Installation](#Installation) | ||
- [Design & Implementation](#design) | ||
- [Architecture](#architecture) | ||
- [Frontend / User Interface](#frontend--user-interface) | ||
- [Parser](#parser) | ||
- [Commands](#commands) | ||
- [Add Command](#add-command) | ||
- [Allocator](#allocator) | ||
|
||
|
||
## Acknowledgements | ||
|
||
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well} | ||
This project utilizes the following dependencies: | ||
|
||
- [JUnit 5.10.0](https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api/5.10.0) for testing. | ||
- [AsciiTable 0.3.2](https://mvnrepository.com/artifact/de.vandermeer/asciitable/0.3.2) for formatting tables. | ||
- [Jackson Databind 2.18.0](https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind/2.18.0) for JSON processing. | ||
- [OpenCSV 5.9](https://mvnrepository.com/artifact/com.opencsv/opencsv/5.9) for CSV parsing. | ||
|
||
Many thanks to the developers and maintainers of these libraries for their incredible work. Their efforts have significantly contributed to the success of this project. | ||
|
||
## Installation | ||
|
||
To get started with this project, follow these steps: | ||
|
||
### Prerequisites | ||
|
||
- Java 17 | ||
- Download the latest `.jar` from [here](https://github.com/AY2425S1-CS2113-W12-2/tp/releases/tag/v1.0). | ||
|
||
### Steps | ||
|
||
1. **Copy the `.jar` file:** | ||
- Move the downloaded `.jar` file into a designated folder on your computer. | ||
|
||
2. **Prepare your data file:** | ||
- If you want to parse a file (.CSV, .JSON, .TXT) containing student data, ensure you have the absolute path ready for that file. | ||
|
||
3. **Run the `.jar` file:** | ||
- Open a terminal. | ||
- Navigate (`cd`) to the folder containing the `.jar` file. | ||
- Execute the `.jar` file using the following command: | ||
```shell | ||
java -jar FindOurSEP.jar | ||
``` | ||
|
||
|
||
🎉 Congratulations! You’re all set to dive into the wonders of this project. Enjoy the ride! | ||
|
||
## Design & Implementation | ||
|
||
### Architecture | ||
|
||
![Architecture](UML_Diagrams/Architecture.drawio.svg) | ||
|
||
|
||
### Frontend / User Interface | ||
FindOurSEP is primarily a Command-Line Interface (CLI) based Java Application. The frontend currently consists of 2 main | ||
components: | ||
1. `UI` class - Manages interactions with the user, including printing messages, tables, and capturing user inputs. | ||
2. `Messages` enum - Stores standardized messages for consistent user prompts and feedback across the application. | ||
#### 1. `UI` Class | ||
The `UI` class is designed to handle both input and output for the command-line interface. It manages user prompts, | ||
input retrieval, and formatting for both regular messages and ASCII tables displaying lists. | ||
|
||
Here is the class diagram highlighting the structure of the `UI` class. | ||
![UIClass](UML_Diagrams/UIClass.drawio.svg) | ||
|
||
How `UI` Works: | ||
1. Whenever the program needs to interact with the user, it does so through the `UI` class, which serves as a **facade** | ||
between the logical backend components and the user interface elements. | ||
|
||
2. The `UI` class is responsible for displaying messages, receiving user input, and printing data formatted as tables or | ||
text responses. | ||
|
||
3. Upon receiving a message or command request, the UI class formats the message, incorporating relevant content | ||
(e.g., student details or allocation results) before displaying it to the user. This approach maintains separation | ||
between backend logic and the presentation layer. | ||
|
||
4. For each user action, such as displaying a list of students or allocating slots, the `UI` class uses helper methods | ||
(e.g., `printStudentList`, `generateReport`) to format and render the output. The methods ensure the responses are | ||
consistent and user-friendly. | ||
|
||
The `UI` class methods typically return `void`, but will print responses directly to the console or handle user input, | ||
streamlining interactions and allowing the backend to focus solely on data processing. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe its better to include when does it not return void |
||
|
||
#### 2. `Messages` Enum | ||
The `Messages` enum centralizes common UI messages. For example, `Messages.ERROR` is passed to the UI for | ||
display for default errors. This keeps responses uniform and allows for changes to user-facing text without modifying | ||
backend logic. List of all `Messages`: | ||
|
||
`WELCOME`: Greeting message displayed at startup. | ||
|
||
`EXIT`: Farewell message when exiting. | ||
|
||
`ALLOCATE_COMPLETE`: Shown upon completion of the allocation process. | ||
|
||
`HELP`: Multi-line help message listing all available commands and their descriptions. | ||
|
||
`ERROR`: General error message for unexpected issues. | ||
|
||
`REVERT_COMPLETE`: Message displayed after a successful revert operation. | ||
|
||
Each message can be accessed and printed via `Messages.<MESSAGE_NAME>` in the `UI` class or any other class that | ||
references it. | ||
|
||
#### Customizing and Extending the UI | ||
Adding New Messages: | ||
1. Open the `Messages` enum. | ||
2. Add a new constant with the message text. Example: | ||
```java | ||
NEW_MESSAGE("Your custom message text here"); | ||
``` | ||
3. Reference the new message in the `UI` class or any other relevant part of the application using `Messages.NEW_MESSAGE` | ||
|
||
|
||
|
||
### Parser | ||
|
||
The `Parser` class is a crucial component instantiated as soon as FindOurSEP is initialized. Its responsibility is to process the user’s input into commands and invoking the correct command object for the rest of the program. | ||
|
||
Some of its core features include: | ||
- Breaking down user input and extracting the relevant command and data for further processing. | ||
- Provide robust error handling when unknown command is received. | ||
- Validate data parsed in from external file (.CSV, .JSON, .TXT) sources. (Further details in the `Storage` class) | ||
|
||
Here is a class diagram highlighting the fundamental structure of the `Parser` class. | ||
|
||
![ParserClass](UML_Diagrams/ParserClass.drawio.svg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
How `Parser` works: | ||
1. Whenever the user enters an input, the input will be directed to the `Parser` class's `parseInput()` method. | ||
2. Within the method, the command will be extracted and the appropriate `XYZCommand` object (XYZCommand is a placeholder for various commands such as DeleteCommand, ListCommand, etc.) will be instantiated. | ||
3. Upon instantiation, the `XYZCommand` is prepared for execution. Each `XYZCommand` class, inheriting from the abstract `Command` class, has a `run()` method that executes its specific instructions. | ||
|
||
The sequence diagram below demonstrates the interactions within the `Parser` component when a user inputs the command: `add id/A1234567I gpa/5.0 p/{13,61,43}`. | ||
|
||
![ParserSequence](UML_Diagrams/ParserSequence.drawio.svg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The return type should not have |
||
|
||
The boolean return value of `parseInput()` indicates whether the user has chosen to continue or terminate the program. A `true` value keeps FindOurSEP running, while a `false` value ends the program. | ||
|
||
### Commands | ||
|
||
#### Add Command | ||
|
||
## Design & implementation | ||
#### Delete Command | ||
|
||
{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} | ||
Delete Command removes an exisiting Student in the StudentList. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe can explain in greater detail, particularly what is the return string for. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
![DeleteCommandSequence](./UML_Diagrams/deleteCommand.drawio.svg) | ||
|
||
#### Criteria Command | ||
|
||
Criteria Command sets a minimum GPA every student must acheieve before they can be allocated to a university. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May be irrelevant to DG, but the method name is inconsistent ('gpa' in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Holy-An 👀 |
||
|
||
![CriteriaCommandSequence](./UML_Diagrams/CriteriaCommand.drawio.svg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, its nice to explain how the returned float is used. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
#### Find Command | ||
|
||
#### Filter Command | ||
|
||
#### Stats Command | ||
|
||
#### ViewQuota Command | ||
|
||
|
||
#### List Command | ||
|
||
#### Stats Command | ||
|
||
The `StatCommand` class implements the `stats` command, which provides GPA-related statistics (average GPA or minimum GPA) for students associated with a specified university. The command syntax is `stats <stat_type> <UNI_INDEX>`, where `<stat_type>` can be `-avggpa` for average GPA or `-mingpa` for minimum GPA. | ||
|
||
![StatSequence](UML_Diagrams/StatSequence.drawio.svg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think its better to standardize all the sequence diagrams for your commands. Either make the activation bar starts form the Command class directly or use dotted line first. |
||
|
||
#### ViewQuota Command | ||
|
||
The `ViewQuotaCommand` class handles the `viewQuota` command to display information about a university’s remaining quota (available spots) based on a specified university index. | ||
|
||
![ViewQuotaSequence](UML_Diagrams/ViewQuotaSequence.drawio.svg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think its better to leave the return variable name, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
#### Allocate Command | ||
|
||
The `AllocateCommand` class manages the allocation process of students using the `Allocator` class. This command sets up an allocation process for students in the specified `StudentList` and informs the user that allocation is underway. | ||
|
||
You could refer to [Allocator](#allocator) section to check the detailed workflow of ``AllocateCommand``. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
#### Revert Command | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
![RevertSequence](UML_Diagrams/RevertCommandSequence.drawio.svg) | ||
|
||
Upon parsing a `revert` command, a `RevertCommand` instance is created. `RevertCommand` then calls the `revertAllocation()` | ||
method in `StudentList`, which loops through all the students in the `students` array list. The method `revertAllocation()` | ||
within the `Student` objects resets the allocation status and allocated university. The operation is completed by calling | ||
the `UI` to print the templated response from the `Messages` enum. | ||
|
||
#### Exit Command | ||
|
||
#### Help Command | ||
|
||
#### Generate Command | ||
|
||
![GenerateSequence](UML_Diagrams/GenerateCommandSequence.drawio.svg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the return arrow of |
||
|
||
The `generate` command is calls the `generateReport()` method in `StudentList`, which then calls the `generateReport()` | ||
in the `UI` using the student array list, which prints an ASCII table representing the allocation outcome. | ||
|
||
#### Unknown Command | ||
|
||
#### Exit Command | ||
|
||
### Allocator | ||
|
||
The `Allocator` class is responsible for allocating students to universities based on their preferences and GPA. It interacts with the `StudentList`, `UniversityRepository`, and `Student` classes to perform the allocation. | ||
|
||
In ``V1.0`` version, the allocation logic is designed as follows: | ||
|
||
* **Sorting by GPA**: The list of students is sorted in descending order of GPA, so higher-GPA students are prioritized. | ||
* **Preference-Based Allocation**: For each student: | ||
* Iterates through the student’s university preferences. | ||
* Checks if the university has open spots and if the student’s GPA meets the `minimumGPA` requirement. | ||
* If both conditions are met, the student is allocated to that university, and the university’s spot count is reduced. | ||
* The allocation stops once a student is assigned to a university. | ||
* **Sorting by ID**: After allocation, the list is re-sorted by student ID. | ||
|
||
Note that ``Allocator`` will copy the passed student list, therefore any modifications to the student list inside ``Allocator`` will not reflect in the original one. | ||
|
||
Here is a class diagram highlighting the fundamental structure of the `Allocator` class. | ||
|
||
![AllocatorClass](UML_Diagrams/AllocatorClass.drawio.svg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
``Allocator`` mainly participates in the execution of ``allocate`` command. The sequence diagram below showcases the program workflow when a user inputs the command ``allocate`` (assume before that several students have been added into the student list). | ||
|
||
![AllocatorSequence](UML_Diagrams/AllocatorSequence.drawio.svg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
#### Student | ||
|
||
The `Student` class has a composition relationship with class StudentList. Its purpose is to store key information on the different students that have applied for the Student Exchange Program. Such information include their GPA and university preferences, which helps us allocate them to the various universities fairly, and also other information which helps the app track their allocation status. | ||
|
||
#### StudentList | ||
|
||
The ```StudentList``` is a fundamental component which is initiated as soon as FindOurSEP is initialised. Its purpose is to hold the necessary information of the different students that are applying for SEP. By having the list of students we are able to fairly allocate universities to the different students by comparing them to their cohort. | ||
|
||
The sequence below illustrates the interactions between ```StudentList``` and ```Student``` when an addCommand is called with the appropriate inputs. | ||
|
||
![StudentListSequence](UML_Diagrams/StudentList.drawio.svg) | ||
|
||
#### University and UniversityRepository | ||
|
||
These two classes have a composition relationship, where ```UniversityRepository``` is composed of ```University``` objects. The ```University``` object holds the various crucial information of any single university that is provided in the list of available universities. The ```UniversityRepository``` class then creates a static HashMap and statically inputs the list of universities into this HashMap. This HashMap is then easily accessible by other classes to get any information which may be necessary from the universities. | ||
|
||
## Product scope | ||
|
||
### Target user profile | ||
|
||
{Describe the target user profile} | ||
This was designed for admins handling the allocation of Student Exchange Program (SEP) locations for Computer Engineering (CEG) students at NUS. | ||
|
||
### Value proposition | ||
|
||
{Describe the value proposition: what problem does it solve?} | ||
The app allows administrators to efficiently manage the allocation process using automated workflows and data-driven decision-making. Giving the administrators greater convenience when allocating students for their SEP. | ||
|
||
## User Stories | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
# Duke | ||
# FindOurSEP | ||
|
||
{Give product intro here} | ||
FindMySEP is a Command Line Interface (CLI) tool designed for admins handling the allocation of Student Exchange | ||
Program (SEP) locations for Computer Engineering (CEG) students at NUS. The app allows administrators to efficiently | ||
manage the allocation process using automated workflows and data-driven decision-making. | ||
|
||
Useful links: | ||
* [User Guide](UserGuide.md) | ||
* [FindOurSEP User Guide](UserGuide.md) | ||
* [Developer Guide](DeveloperGuide.md) | ||
* [About Us](AboutUs.md) |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall there are no major errors with the UML diagrams presented. Good job