Skip to content

Commit 684ef08

Browse files
committed
Readme updates.
1 parent 620bbc4 commit 684ef08

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ This is the project for the third course in the [Udacity C++ Nanodegree Program]
44

55
<img src="images/chatbot_demo.gif"/>
66

7-
The ChatBot project creates a dialogue where users can ask questions about some aspects of memory management in C++. After the knowledge base of the chatbot has been loaded from a text file, a knowledge graph representation is created in computer memory, where chatbot answer represent the graph nodes and user queries represent the graph edges. After a user query has been send to the chatbot, the Levenshtein distance is used to identify the most probable answer. The code is fully functional as-is and uses raw pointers to represent the knowledge graph and interconnections between objects throughout the project.
7+
The ChatBot code creates a dialogue where users can ask questions about some aspects of memory management in C++. After the knowledge base of the chatbot has been loaded from a text file, a knowledge graph representation is created in computer memory, where chatbot answers represent the graph nodes and user queries represent the graph edges. After a user query has been sent to the chatbot, the Levenshtein distance is used to identify the most probable answer. The code is fully functional as-is and uses raw pointers to represent the knowledge graph and interconnections between objects throughout the project.
8+
9+
In this project you will analyze and modify the program. The program can be executed and works as intended. However, no advanced concepts as discussed in this course have been used; there are currently no smart pointers, no move semantics and not much thought has been given to ownership or memory allocation.
10+
11+
Your goal is to use the course knowledge to optimize the ChatBot program from a memory management perspective. There are a total of five specific tasks to be completed, which are detailed below.
812

913
## Dependencies for Running Locally
1014
* cmake >= 3.11
@@ -29,20 +33,20 @@ The ChatBot project creates a dialogue where users can ask questions about some
2933
3. Compile: `cmake .. && make`
3034
4. Run it: `./membot`.
3135

32-
## Project Tasks
36+
## Project Task Details
3337

3438
Currently, the program crashes when you close the window. There is a small bug hidden somewhere, which has something to do with improper memory management. So your first warm-up task will be to find this bug and remove it. This should familiarize you with the code and set you up for the rest of the upcoming tasks. Have fun debugging!
3539

3640
Aside from the bug mentioned above, there are five additional major student tasks in the Memory Management chatbot project, which are:
3741

3842
### Task 1 : Exclusive Ownership 1
39-
In file `chatgui.h` / `chatgui.cpp`, make _chatLogic an exclusive resource to class `ChatbotPanelDialog` using an appropriate smart pointer. Where required, make changes to the code such that data structures and function parameters reflect the new structure.
43+
In file `chatgui.h` / `chatgui.cpp`, make `_chatLogic` an exclusive resource to class `ChatbotPanelDialog` using an appropriate smart pointer. Where required, make changes to the code such that data structures and function parameters reflect the new structure.
4044

4145
### Task 2 : The Rule Of Five
42-
In file `chatbot.h` / `chatbot.cpp`, make changes to the class ChatBot such that it complies with the Rule of Five. Make sure to properly allocate / deallocate memory resources on the heap and also copy member data where it makes sense to you. In each of the methods (e.g. the copy constructor), print a string of the type "ChatBot Copy Constructor" to the console so that you can see which method is called in later examples.
46+
In file `chatbot.h` / `chatbot.cpp`, make changes to the class `ChatBot` such that it complies with the Rule of Five. Make sure to properly allocate / deallocate memory resources on the heap and also copy member data where it makes sense to you. In each of the methods (e.g. the copy constructor), print a string of the type "ChatBot Copy Constructor" to the console so that you can see which method is called in later examples.
4347

4448
### Task 3 : Exclusive Ownership 2
45-
In file `chatlogic.h` / `chatlogic.cpp`, adapt the vector _nodes in a way that the instances of `GraphNodes` to which the vector elements refer are exclusively owned by the class `ChatLogic`. Use an appropriate type of smart pointer to achieve this. Where required, make changes to the code such that data structures and function parameters reflect the changes. When passing the `GraphNode` instances to functions, make sure to not transfer ownership and try to contain the changes to class `ChatLogic` where possible.
49+
In file `chatlogic.h` / `chatlogic.cpp`, adapt the vector `_nodes` in a way that the instances of `GraphNodes` to which the vector elements refer are exclusively owned by the class `ChatLogic`. Use an appropriate type of smart pointer to achieve this. Where required, make changes to the code such that data structures and function parameters reflect the changes. When passing the `GraphNode` instances to functions, make sure to not transfer ownership and try to contain the changes to class `ChatLogic` where possible.
4650

4751
### Task 4 : Moving Smart Pointers
4852

0 commit comments

Comments
 (0)