Starting from:

$25

CSCI3901- Final Project Covid-Contact-Tracing Solved

Goal 

The course project is your opportunity to demonstrate all of the concepts from the course in one body of work.

 

Project Structure 

The final project will have you apply your problem solving and development skills.  The solution will require you to bring together

-       Abstract data types and data structures

-       Java implementation

-       Basic algorithms

-       Software development techniques including version control, testing, debugging, and defensive programming

-       Good software program design

-        Database design and use

While we provide a recommended problem for the course, you have the option of proposing a different problem for the project.  A project proposal must include a non-trivial example of all the concepts mentioned above.

 

The project milestones do not change if you choose to propose your own problem.

 

The project is _not_ expected to include a user interface component or software that directly accesses a device’s hardware.

 

Recommended Problem 

One of the tools to help us manage the COVID-19 pandemic is contact tracing.  When one person is diagnosed with COVID-19, the ability to notify other individuals who have been in contact with the person who is COVID-positive allows us to limit the spread of the disease faster.

 

At the same time, the ability to use contact information to detect the frequency of large gatherings also helps us understand the community’s compliance with physical distancing advisories.

 

For this project, you will replicate scaled-down functionality of the Canadian federal government’s application for contact tracing.

 

The big picture of the Canadian application 

At a high level, each individual has an application on their mobile phones that detect instances of the same application on nearby mobile phones through Bluetooth connections.  The phones record the date and duration of the contacts with other phones and periodically report these contacts, in an anonymized manner, to a central database in the government.

 

When an individual is diagnosed with COVID-19, that diagnosis is also recorded in the central database.  Any individual who has been in contact with the diagnosed case within 14 days is then notified of the contact on the next time that their mobile phone contacts the central database.

 

We can also use the central database to check for large gatherings.  Given a large gathering, many of the individuals at the gathering will report contact with the same or similar set of individuals.  Identifying these clusters of tightly-connected individuals on a daily basis gives us a sign of how frequently large groups are gathering; we can then watch for increases in COVID-19 diagnoses following those events.

 

Figure 1 Canadian COVID-19 tracking application overview 

 

Privacy is maintained in the system by having each individual identified by a hash of device information rather than with a login.  The hash cannot be inverted.  Mobile phones only exchange their hashes when they detect contact, and the mobile phones only report hashes (theirs and of others) to the Canadian government, so the government cannot identify who is who.

 

The project simplification 

In the class project, you will _not_

-       Detect or create Bluetooth connections between devices

-       Draw device information from the hardware to create a hash

-       Create timers to periodically upload contact information from your implementation to the Canadian government’s database (or a class database)

Instead, you will have a method that to invoke to record a contact with someone else and a method to invoke to trigger an upload of your collected contact information to a database.

 

You will need at least two classes.  The first class, called MobileDevice, will have the functions that the mobile phone would do:  

-       store contacts with others, upload the contacts to the central database,  

-       report that you have been tested positive for COVID-19 to the central database, and

-       report back if the central database tells us that someone we’ve been around has been diagnosed with COVID-19.

The second class, called Government, will have the functions that are centralized:

-       storing the overall set of contacts,

-       storing the test results,

-       notifying individuals who contact the database if they have been in contact with someone who has tested positive for COVID-19, and

-       being able to report the number of large gatherings on any particular date.

The reporting of data from MobileDevice to Government will happen with method calls.  However, you should think about what the final result would look like if they communicated with one another through a network socket (one of the last topics in the class) in a client-server architecture.   

 

Specific methods are described in the next section, along with the criteria on what it means to detect a large gathering.  You are permitted to add exceptions to these methods and return values…as long as you document them.

 

Figure 2 Project general interaction structure for the MobileDevice and Government classes 

In the final solution, you also design the database (remember to include the SQL script to create it).  Calls to the MobileDevice and the Government classes will happen from a main() method that you provide.  Marking may also have JUnit tests that invoke the methods directly.  

 

Functionality for MobileDevice 

MobileDevice( String configurationFile, Government contactTracer ) 

Constructor for the class.  It accepts a configuration file that contains the device’s network address (string) and device name (string); these would normally come from the hardware, but we’ll put them in the configuration file instead for simplicity. The configuration file will have one line for each configuration value.   

 

The format of a line is  <keyword=<value

where “keyword” is either “address” or “deviceName”.  You are welcome to add other configuration parameters.

 

contactTracer is the object that represents the government and that you will use to record your results.

 

recordContact( String individual, int date, int duration ) 

When our Bluetooth driver (not part of this project) detects another device, that drive calls recordContact to locally record that “individual” was near us on “date” for “duration” minutes.  The date is the number of days since January 1, 2020.

 

These contacts do _not_ go to the government system right away.  They are stored in MobileDevice until the time comes to send the bulk of contacts to the government.

 

positiveTest( String testHash ) 

The user interface (not part of this project) will call positiveTest when the user asks to tell the system that they have tested positive for COVID-19.  The testing agency will provide an alphanumeric string that identifies the test; the user will record that string to link those results to the individual who normally uses the mobile device.  testHash will need to be matched with a test result in the Government system.

 

boolean synchronizeData( ) 

 Some process on the mobile device (not part of this project) will invoke this method periodically to trigger an exchange with the Government database.  When invoked, the application will package all of the information in the mobile device into a formatted string and send that information to the government through the government object’s mobileContact method.  The information packaged up includes the device’s hash, any contacts, and positive test hashes reported by the owner of the phone (as user calls to positiveTest).  The method gets back from the government an indicator of whether or not this mobile device has been near anyone

Deleted: use a network socket to connect with the preconfigured database server to upload

Deleted: or 

Deleted: results 

Deleted: made and to find out if 

diagnosed with COVID-19 in the last 14 days.  That outcome is the return value of synchronizeData:  true if the device has been near someone with covid-19 and false otherwise.

 

 The MobileDevice class will _not_ write SQL statements to the government database.  You will encode your data for the government object; the format is of your choice, but I recommend that you consider organizing your data in an XML format.  The government object, acting as a server, will then parse the string from the mobile device and store or retrieve data from the database.

 

Functionality for Government 

Government( String configurationFile ) 

Constructor for the class.  It accepts a configuration file that contains the domain name of the database for the government (string), the username to access the database (string) and the password to access the database (string).

 

The configuration file will have one line for each configuration value.  The format of a line is  

<keyword=<value

where “keyword”  is either “database”, “user” or “password”.  You are welcome to add other configuration parameters.

 

boolean mobileContact( String initiator, String contactInfo ) 

 This method is called by the mobile device “synchronizeData” method to send the contact information to the government.  The caller is identified in the system by “initiator”, which is a String HashCode of the mobile device’s network address and the mobile device’s name.  (As a hash, it won’t identify the user, and we will provide a degree of unique identification by combining the hardware network address and the device name).

 

All the contact information is contained in the contactInfo string.  You, as designer, get to define the structure of contactInfo.  Be sure to document your format.

 

The method returns whether or not the contacting mobile device has been near someone who tested positive for COVID-19 within 14 days of their contact.  Only new COVID-19 contacts are reported back.

 

These contacts _must_ be stored in the government database to survive restarts of the program.

 

recordTestResult( String testHash, int date, boolean result ) 

Record in the database that a test, identified by the alphanumeric string testHash, had a collection taken up on “date”, and came out positive (result = true) or negative (result = false).  The date is the number of days since January 1, 2020.

 

int findGatherings( int date, int minSize, int minTime, float density ) 

Deleted: It will exchange messages through a protocol 

(message exchange of your choice) with a server

Deleted: messages 


Looking at the contacts reported on “date”, return the number of large gatherings on that date. The date is the number of days since January 1, 2020.

 

To detect a gathering, consider all pairs of individuals A and B.  Find the set S of people that both A and B contacted on that day (including A and B).  We only consider S as a gathering if it contains at least minSize indviduals.

 

To detect a large gathering, count the number of pairs of individuals c within S who contacted one another on the given date for at least minTime minutes.  Recall that if S contains n individuals then there can be at most n(n-1)/2 possible pairs.  We then compare c with this maximum: if c / (  n(n-1)/2 ) is greater that density then the gathering is deemed large and worth reporting.  In such an instance, we then remove all individuals in S from our continued search for large gatherings on this day.

 

 

More products