Partner MP

MP7 is a partner MP!

  • The creative “Part 1” must be completed by yourself and must be unique (and different from your partner’s work).
  • Part 2 and Part 3 of this MP can be completed with a partner!

You should denote who you work with in the PARTNERS.txt file in this MP. If you worked alone, include only your NetID in PARTNERS.txt.

Goals and Overview

In this MP you will:

Checking Out the Code

From your CS 225 git directory, run the following on EWS:

git fetch release
git merge release/mp7 -m "Merging initial mp7 files"

If you’re on your own machine, you may need to run:

git fetch release
git merge --allow-unrelated-histories release/mp7 -m "Merging initial mp7 files"

MP 7.1: Create a Choose Your Own Adventure

Solo Portion

This creative part of the MP must be completed individually and must be significantly different from your partner’s creative work.

An interactive story presents a reader with a narrative and allows her a choice of options to advance the story. For example, the story may read:

Zoey walks into a long hallway, where she sees three doors. The first, a large old oak door, is slightly ajar; the second, a narrow passageway that looks as though it leads into another hallway; and the third, a sterile metal door that is propped open with a large stone. Uncertain which way to travel, she takes a second to consider each choice.

From the above narrative, the reader chooses where Zoey advances next through an interactive choice:

At the core, every interactive story makes a graph. Each vertex is a narrative and each edge is a choice that leads from one narrative to another. In this activity, you will write your own interactive story and construct a graph of your story.

Format Specification

Your story will consist of several Markdown (.md) files that has one narrative and any options to move forward in the story. For example, waf-zoey.md is already in your data folder:

Zoey walks into a long hallway, where she sees three doors. The first, a large old oak door, is slightly ajar; the second, a narrow passageway that looks as though it leads into another hallway; and the third, a sterile metal door that is propped open with a large stone. Uncertain which way to travel, she takes a second to consider each choice.

# waf-zoey-oak
After a moment, Zoey chooses to travel through the oak door.

# waf-zoey-narrow
With a bit of fear, Zoey chooses to travel through the narrow passageway.

# waf-zoey-metal
Walking to the end of the hallway, Zoey chooses to travel through sterile metal door.

Note the following bits:

Story Requirement

To complete Part 1, your story must feature at least one of these ten people that you and your peers felt was most influential (in random order):

You do not need to only feature these people (you can feature others!) but your story must feature at least one of these people. This will help you find others who have similar stories to join with you during Part 3.

In addition to the featured person(s), the following conditions must be met:

Part 1: Strict Due Date

Your story is due December 3, 2018 (hard deadline, no grace period). You will earn extra credit for this MP by combining your story with others – more on that soon!

Testing

Once you complete Part 2, you will have a program to test the format of your graph.

Submission

To commit your changes to the repository type:

git add -u
git add data
git commit -m "<your message>"
git push origin master

MAKE SURE all of your data files are added and all of the waf-* files are deleted!

MP 7.2: Adjacency List

You have been provided with an incomplete Graph implementation for an adjacency list implementation. You must complete all functions in Graph.hpp without editing Graph.h. This means you must make use of the std::unsorted_map that maintains the vertices and std::list that maintains the edges.

Open the doxygen for class Graph

Runtime Required

In this MP, tests are designed to ensure you have an implementation that runs in the running time described in lecture of the adjacency list, with the exception of vertex/edge removal. You will find several test cases require a specific running time to be met.

Most importantly, ensure your Graph::incidentEdges and Graph::isAdjacent functions run in times described in lecture.

./mp7 main file

The main.cpp file loads your interactive story from your data directory. A complete implementation of Part 2 will allow you to verify the format of your story in Part 1.

Tip on std::reference_wrapper

std::reference_wrapper<class T> is a useful utility that lets std::container based structures like std::list to be able to store references to data instead of needing to internally copy data into the container data structure. To access the reference from the std::reference_wrapper<class T>, please use the std::reference_wrapper<class T> member function T& get() const noexcept to retrieve the wrapped reference.

Test Suite

Additional unit tests similar to how we will grade your MP are provided for you in tests.

make test
./test

MP 7.3: Creative Sub-Structures

The final thing to do in MP7 is to create a shortest path algorithm! You must find and return the shortest path between a given start vertex and end vertex.

Complete Graph<K,V>::shortestPath(...) within Graph2.hpp. This function will allow you to find your shortest path in the course-wide graph!

Partner MP

Don’t have Graph2.hpp?

  • Graph2.hpp is part of the “Part 3” release. To get all the latest files, run:
git fetch release
git merge release/mp7 -m "Merging mp7 part 3 files"

If you’re on your own machine, you may need to run:

git fetch release
git merge --allow-unrelated-histories release/mp7 -m "Merging mp7 part 3 files"

Grading Information

The following files are used to grade MP7 so far:

All other files will not be used for grading.

No Memory Leak Grading!

You do not need to worry about leaking memory in this MP – we will not test (and you will have) unfree’d memory when you program exists.

Submission

To commit your changes to the repository type:

git add -u
git commit -m "<your message>"
git push origin master