CSE 321 Lab 6


Table of Contents


Objective

The objective for this assignment is to design and implement a new component family. Note that this document only outlines the requirements and expectations for this lab. The details of what to do in each step will be discussed in class (attendance, of course, is required). For any questions left unresolved in class, you should post messages to the Carmen discussion groups. This way questions and answers can be shared by everyone in the class.


Overview

The new component family that you will design and implement consists of an abstract kernel component, a concrete kernel implementation, and a checking implementation of the kernel. In addition, you will write a program that uses the new components to generate a tag cloud. You can also design any abstract extension(s) for the new kernel and provide implementation(s) for these extension(s), if you think that would be useful in implementing your tag cloud program, but this is not required.


Materials Provided

The set up instructions will provide you with a user catalog containing the following files: You will need to do the following:
  1. Design a new abstract kernel component according to the requirements outlined in Homework #17 and refined in class.
  2. Implement a concrete kernel component that implements the abstract component you defined in the previous step.
  3. Implement a checking kernel component for any kernel implementation of the new abstract component.
  4. Write a main program that generates tag clouds by using, among others, your new components.
  5. Optional: Design any useful abstract extension component for the your new kernel, and
  6. Implement your new extension and use it in your program.

See the Details section below for more information.

Important! Note that these steps have to be followed pretty much in this order. The only flexibility is that you can start writing the main program once you have an implementation of the kernel component (though it may be useful to implement the checking kernel and any needed extension before the main program so that you can use those components to simplify the main program).


Set Up

  1. Copy the lab6 course catalog to your group project directory (/project/c321axnn, where "x" is your section letter and "nn" is your team number):
    cp -r /class/sce/now/321/labs/catalogs/lab6 /project/c321axnn
    
  2. Make sure that the new catalog will be accessible to your partner. Perform this action now and as your last act whenever you finish a working session. Note that 'l' in the chmod command is the letter 'l' ("el"), as in "lock":
    cd /project/c321axnn/lab6
    
    chmod -R g-l,g+rwX .
    
    set-group-ID .
    
  3. Look around the new user catalog to familiarize yourself with its contents.


Details

Here are some more details about each of the tasks/components you need to work on.

  1. Design a new abstract kernel component: Most of the actual design work should be done in class. Then, starting from the abstract kernel skeleton available from the Resolve/C++ catalog, you should create your new component. Choose an appropriate, descriptive name, and complete the component with the mathematical model, initial value, and kernel operations with requires and ensures. You will also need to define appropriate template parameter(s).
  2. Implement the kernel component: Start from the concrete kernel skeleton available from the Resolve/C++ catalog. You need to choose the representation, and decide how to implement the kernel operations. Provide appropriate default values for all the template parameters that can be chosen by the implementer. Include the convention and correspondence clauses, and specify and implement any local operations needed by your implementation.
  3. Implement a checking kernel component: Start from the checking kernel skeleton available from the Resolve/C++ catalog. Provide checking implementations for all the kernel operations that have a requires clause.
  4. Write a main program to generate tag clouds: You can read about tag clouds at Wikipedia. Your program should read some text from standard input, count the occurrences of the words in the text, and output to standard output a tag cloud in HTML. At a minimum, your output should display each word with a font size that is proportional to the number of occurrences of the word.

    The sample output provided (TagCloudSample.html) shows the HTML needed to display a tag cloud. This file only displays the most frequent 100 words in the sample text (importance.txt). This is a more effective use of a tag cloud than trying to display all the words that occur in the document. For the purpose of this lab, it is OK to hardcode the number of most frequent words you want to output. Note that the provided style sheet (tagcloud.css) is needed to be able to display the tag cloud correctly.

    Here is a list of possible feature of your program and the resulting tag cloud (required ones are tagged that way, but I would recommend experimenting with as many of these as you have time for).

    A good starting point for your main program is the CountWords program you implemented in Closed Lab #7. However, make sure you use your new components in the program. You can't simply modify the original program to output the tag cloud without employing all your new components. Note also that your main program (just like all the other components) is expected to follow the high-quality standards of all submissions in 221/222/321. So make sure you structure your solution well (by specifying and implementing the needed global operations), you comment everything appropriately, format everything consistently, etc.

  5. Design a new abstract extension: If you come up with a general purpose extension to your new kernel component that can be useful in your tag cloud program, you can create the new component by completing the abstract extension skeleton available from the Resolve/C++ catalog.
  6. Implement the extension: Start from the concrete extension skeleton available from the Resolve/C++ catalog. Provide the implementation for the new operation(s) and specifications and implementations for any local operations needed.

    Finally, make sure you use your extension in your tag cloud program.

Make sure that your catalog has the correct structure and that all components are in the appropriate location (e.g., abstract templates are under lab6/AT/Family/ and concrete templates are under lab6/CT/Family/, where Family is the name of your new component family).


What To Submit

Once you and your partner are satisified with your design and convinced that all implementations are working correctly, get into your group's lab6 directory /project/c321axnn/lab6 in an xterm window and use the rcpp-submit command to submit your solution as follows (noting that you will need to use the appropriate suffix in place of ?? in this command, as posted next to your instructor's name on the CSE 321 Home Page):
rcpp-submit c321?? lab6
If you get an error message rather than a confirmation of success, please read the message; it contains useful information! Do not just run the same command again. Save the e-mail you get as a receipt of submission, just in case.