Project 5: FastLane Tracker

Adding the Tracker application to the FastLane project

Revision dated 10/20/17

Educational Objectives: After completing this assignment the student should have the following knowledge, ability, and skills:

Operational Objectives: Create an object-oriented vehicle counter for use by the Department of Transportation (DOT).

Deliverables: tracker.cpp, makefile, log.txt

Ancillary Deliverables: This project depends on copies of these files delivered with the previous project: vehicles.h, vehicles.cpp, shapes.h, and shapes.cpp. These will also be collected by the submission process.

Assessment Rubric

----------------------------------------------------
student build: (3 pts)
 stester.x                             [0..1]:    x
 vtester.x                             [0..1]:    x
 tracker.x                             [0..1]:    x
project build: (3 pts)
 build stester.x                       [0..1]:    x
 build vtester.x                       [0..1]:    x
 build tracker.x                       [0..1]:    x
compatibility of framework: (4 pts)
 diff shapes.h                         [0..1]:    x
 diff shapes.cpp                       [0..1]:    x
 diff vehicles.h                       [0..1]:    x
 diff vehicles.cpp                     [0..1]:    x
project tests: (40 pts)
 stester.x stester.com                 [0..5]:    x
 vtester.x vtester.com                 [0..5]:    x
 tracker.x < shift1.in                 [0..5]:    x
 tracker.x < shift2.in                 [0..5]:    x
 tracker.x < shift3.in                 [0..5]:    x
 tracker.x < shift4.in                 [0..5]:    x
 tracker.x < shift_wide.in             [0..5]:    x
 tracker.x < shift.paragraph           [0..5]:    x
software engineering:
 code quality, requirements          [-30..0]:  ( x)
 code standards                      [-10..0]:  ( x)
dated submission deduction        [2 pts per]:  ( x)
                                                 --
total                                 [0..50]:   xx 
----------------------------------------------------

The FastLane Tracker Project

This project simulates an application called tracker for the Florida Department of Transportation in which data from FastLane transponders is accumulated in real time using various sensing equipment. The sensors detect a FastLane-equiped commercial vehicle (licensed carrier of people or freight) and actively inquire further data from that vehicle. The data is recorded and the vehicle is allowed to proceed without entering the upcoming inspection station, thus saving a great deal of time for both the vehicle operator and the inspection station staff. Of course, there is a one-time inspection required for these vehicles, and electronic guards prevent tampering with inspectable aspects of the vehicle. Data from the one-time inspection is available from a secure cloud database for use by inspectors if required.

For all commercial vehicles the following data is collected:

Additional data is collected depending on the specific type of vehicle:

Note that operators are not counted in passenger capacity, so that there is a strict divide between carriages, which carry people as passengers, and trucks, which carry freight. A carriage may not carry freight and a truck may not carry passengers.

Tracker is set up adjacent to a DOT inspection station. Once activated, it keeps a running account of the FastLane equipped passing vehicles for a period of time called a "shift". At the end of a shift, tracker reports summary data and also creates a detailed log of each instance of a FastLane interaction during that shift.

The current assignment focuses on the "client side" of the FastLane project. The tracker client program uses the CommercialVehicle framework built in the preceeding assignment.

Procedural Requirements

  1. Create and work within a separate subdirectory cop3330/proj5. Review the COP 3330 rules found in Introduction/Work Rules.

  2. Begin by copying all files from LIB/proj5 into your proj5 directory. You should see at least the following files:

    shift0.in
    shift1.in
    shift2.in
    shift3.in
    shift3.paragraph
    shift_wide.in
    makefile.partial
    deliverables.sh
    

    Also copy area51/tracker_i.x and change its permissions to executable. tracker_i.x is the benchmark executable against which yours will be tested. Note that you can add these lines to your makefile to ensure that you have a current executable benchmark:

    tracker_i.x: /home/courses/cop3330p/LIB/area51/tracker_i.x
    <TAB>   cp  /home/courses/cop3330p/LIB/area51/tracker_i.x .
    <TAB>   chmod 700 tracker_i.x .
    

    (Also add "tracker_i.x" to the dependencies for the first target.)

  3. Begin your log file named log.txt. (See Assignments for details.)

  4. Copy the various shapes and vehicles files from the preceeding project: shapes.h, shapes.cpp, vehicles.h, and vehicles.cpp. Be sure that these files remain identical to those from the preceding project. If you need to revise these files, you need to resubmit the previous project. (See rubric above.)

  5. If in the current project you find that the shape and vehicle classes require modification, be sure that you make the modifications in both projects and resubmit the preceding one, so that when we check the requirement above your submissions will pass that check.

  6. Create a client program for all of these classes in the file tracker.cpp.

  7. Starting with the contents of makefile.partial, create a makefile that builds all of these executables: tracker.x, stester.x, vtester.x, tracker_i.x, stester_i.x, vtester_i.x.

  8. Turn in the files tracker.cpp, makefile, and log.txt (along with shapes and vehicles files from project 4) using the submit script.

    Warning: Submit scripts do not work on the program and linprog servers. Use shell.cs.fsu.edu to submit projects. If you do not receive the second confirmation with the contents of your project, there has been a malfunction.

Code Requirements and Specifications - Client Side

  1. You are to implement a client program tracker of the CommercialVehicle framework.

  2. Tracker processes data from a file that is input through redirection and sends results to standard output. (Thus tracker does not deal directly with files but reads from and writes to standard I/O.)

  3. Tracker goes through the following processing loop:

    1. Read the number of vehicles in the next shift
    2. If the number is zero, exit
    3. For each vehicle in the shift,
      1. Read and decode the vehicle serial number
      2. If other data is needed, read that data one token at a time, into approprate variables
      3. Create a vehicle of the appropriate type using the data read in the previous steps
      4. Update various summary information for this shift
    4. After all the vehicles in the shift have been read and their corresponding objects created, report a summary of the various vehicles by type, along with the total passenger and freight capacity for the segment.
    5. After the summary, report the details in table format: feach vehicle in the shift corresponds to a line in the table.
    6. At the end of the shift, release the memory used to store vehicle objects.
    Use the distributed area51 executable as a benchmark for output data and formatting.

  4. Note that the main tracker processing loop continues until zero is read for a shift size. It may be assumed that the file of data is correctly structured so that whenever an appropriate item is expected, it is next in the file. For all vehicles, the data will begin with the serial number sn and then give the remaining information as appropriate. For example, various commercial vehicles would have these lines of data:

    reg id cdl                       <-- vehicle, truck
    reg id cdl pc                    <-- carriage, bus, limo
    reg id cdl width length height   <-- van 
    reg id cdl radius length         <-- tanker
    reg id cdl width length          <-- flatbed
    

    (where reg, id, cdl are strings, pc is a non-negative integer, and the dimensions are floats.) The dimensional data should be interpreted in the order as shown (and as in the constructors of the truck types.

  5. Tracker should instantiate the objects of a shift using an array whose elements are of type CommercialVehicle *, that is, pointer to type CommercialVehicle. At the end of reading the shift data, this array should have pointers to vehicle objects representing the entire shift. These objects should exist until the line in the report representing the object is generated. NOTE: instantiate the objects with the "verbose" variable set to 0 = false (the default).

  6. Use declared constants (not hardcoded literal values) for the following:

    1. The maximum number of vehicles in a traffic shift (100)
    2. The maximum number of characters in an input string [vehicle registration number, operator ID, operator CDL] (50)

  7. Check for a shift size greater than tracker can handle, and exit if that happens. Thus tracker would exit if either size 0 is read or some size greater than the declared constant 6.i above.

  8. Your tracker.cpp source file should #include <vehicles.h>, but not any of the other project files. Your makefile should create separate object files vehicles.o, shapes.o , and tracker.o and then create the executable tracker.x.

  9. Your tracker project will be tested using the classes that you submit with this project. If you need to revise those, you will need to submit the revisions for that project prior to submitting this project.

  10. Your executables should produce output that is identical to that produced by the corresponding benchmark programs.

Hints