Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CS 4610 - Fall 2022

Programming Assignment 4

GSN Model Evolution & XML Parser

Goal

•   In this programming assignment, you are required to read a GSN model via a XML parser and support GSN model evolution!!!

Problem Statement

Check Week 10’s Content about an XML parser. In this project, you are asked to use an XML parser to       stored a GSN model based on the GSN metamodel/class diagram in PA3. The initial GSN model is used to model the initial configuration for a f1/10 race car as shown below.

Based on this GSN model, there are TWO types of changes. One is the minor change that does   NOT change the structure of the GSN model, ie. only the configuration changed that applies to   the content changes in Solution Node Sn1.1.1.1.1.1.1.1, Sn1.1.1.1.1.1.2.1, Sn1.1.1.4.1.1 and C1.1.1.3.1.1, based on a new configuration for an f1/10 race car. One of the changes is shown in the following diagram:

Here is another change based on the second GSN model.

 

The second type of change is a major change. In this case the Nodes for Safety Requirement 1, 2, and 3 are replaced with one Goal Node about Safety Requirement 4. Likewise, some contents of nodes for the configuration are changed accordingly, as shown below.

Input Requirement

Your program should read the xml file for the initial GSN model. Then your program asks a client for the following input:

1.   Are safety requirement R1, R2, and R3 all satisfied?

a.    If yes, ask for a new configuration and then update the GSN model accordingly and print out a new GSN model; back to Question 1

b.    If no, ask a new configuration and then update the GSN model according to the third diagram above. Go to Question 2

2.    Is safe requirement R4 satisfied?

a.    If yes, ask for a new configuration and then update the GSN model accordingly and print out a new GSN model; back to Question 2;

b.    If no, ask a new configuration and then update the GSN model according to the first GSN model.

Any time, if a client input “$”, then your program stops.

(OPTIONAL Part to Skip the Final Exam) Instead of asking a client to provide the above information, your program works with the provided F1tenth car’s program to get the above information.

Output Format

Save the output to an output file named GSN_F1Tenth_Race_Car_Evolution[num] where num is an integer starting at 1. Each change results in the increasing value of num by 1.

The output format is you need to add tab space * level, where level is the height of an element, type of Element such as Goal and SupportedBy, id and content (if exist). For instance, for the  above GSN model, the output should look like as follows.

Goal G1 swap.c is a fault free source file        //there is no tab space before Goal since G1’s height is 0)

InContextOf                                             //height of InContextOf is 1

Justification J1. 1 … .                         //height of Justification is 2 and content should be output

SupportedBy                                        //height of SupportedBy is 1

Goal G1. 1 … .                             //height of Goal is 2 and content should be output

// Same format is expected for the rest of elements.

What You Need to Submit

1.   Show a class diagram as a design model. If you use any design pattern, please use it via the corresponding roles given in that pattern.

2.   Your complete Python/Java Program.

3.   A screenshot of running your program on several test cases with corresponding output files.

Assignment Submission

•   You should submit the following three files:

o Design File

o Program Files

o A file containing a screenshot of some results.