联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> Java编程Java编程

日期:2019-01-09 09:31

Objective:

This assignment has been designed for students to apply appropriate concurrent program methods in implementing a concurrent program from a program specification.

Learning Outcomes

ON COMPLETION OF THIS ASSIGNMENT YOU SHOULD BE ABLE TO DEMONSTRATE THE FOLLOWING LEARNING OUTCOME(S):

1.Explain the fundamental concepts of concurrency in the design of a concurrent system (P01, C2)

2.Apply the concepts of concurrency in the construction of a concurrent system using C# or Java application. (P02, C3)

3.Explain the safety aspects of multi-threaded systems (P03, C4)

4.Justify the need for encapsulation in concurrent systems (P06, C5)

Programme Outcomes (PO):

PO 1 -Ability to gain and apply knowledge of digital information processing, the design of computer systems and software, and the applications of computers to solve complex problems in the area of computer science.

PO2 -Ability to undertake complex computer science problem identification and apply practical skills to solve them.

PO3 -Ability to engage in professional computer sciences practice for safety, health, social, cultural and legal responsibilities in developing solutions for complex computer science problems.

PO 6 -Ability to investigate complex computer science problems using research techniques, and select and use suitable tools and techniques in solving the problems.


No.Learning OutcomeAssessment

1Explain the fundamental concepts of concurrency in the design of a concurrent system (P01, C2)Assignment

2Apply the concepts of concurrency in the construction of a concurrent system using C# or Java application. (P02, C3)Assignment

3Explain the safety aspects of multi-threaded systems (P03, C4)Assignment

4Justify the need for encapsulation in concurrent systems (P06, C5)Assignment


Assignment QuestionCognitive LevelPsychomotor LevelAffective Level

123456123456712345

30M50M10M10M

POM30%50%10%10%


Marking Criteria


The criteria used to evaluate the assignment are as follows:


Appropriateness of coding techniques used to implement design

Appropriateness of the Java concurrent programming facilities used

Program runs appropriately

Explanation of concepts learned in the module

Usefulness of instructions for compiling and running the program including comment lines in source codes.

Presentation of the source code listings – except UI-related codes

Discussion of the safety aspects of multi-threaded system implemented

Discussion of encapsulation implemented

Reporting of appropriate tests of program execution

Depth of discussion – listing of section(s) that did not meet requirements and/or code extracts of sections that met requirements.

Critical Appraisal


Performance Criteria


1.A demonstration of your work to the lecturer. Marks will be allocated on the basis of your ability to deliver a coherent, clear and well-prepared verbal presentation of your system. To achieve a mark of:

oFail: Not able to articulate and explain basic functionality of system

oPass: Your delivery must be clear, but may suffer from a lack of organisation or preparation.

oCredit (Lower): As above, plus your presentation is clear, well organised and prepared. Able to clearly answer questions from your lecturer about your system.

oDistinction: as above, plus the presentation must have an extra spark that makes it stand out from the other presentations. This mark is reserved for presentations that are of an excellent standard.

2.Assessment of functionality. This will be assessed by your tutor experimenting with your electronic submission. To achieve a mark of:

oFail: Your system cannot compile and run.

oPass: The system works properly having met basic requirements. .

oCredit: As above, plus the system provided meets all expected functionality. The system is free from deadlock

oDistinction: As above, plus the system must have an extra spark that makes it stand out from other systems. This mark is reserved for systems that have outstanding functionality, and is free from data corruption and deadlock.

3.Report on Correctness. This report must provide an argument of how you know that your system behaves correctly. To receive a mark of:

oFail: Your report cannot be easily read by your lecturer and has many missing parts.

oPass: Your report must be easily read, informally outline the particular concurrency issues that your system faces and meet satisfactory documentation requirements (seem marking criteria above).  

oCredit (Lower): As above, plus you must provide one of a test report or discussion which shows that your system is free from data corruption and deadlock.

oDistinction: As above, plus the report must be among the best in the class, and must stand out from the other reports in your class.


The Problem

An owner of a bus depot suspects that the way in which the depot is operated means that buses have to spend too much time waiting to be served, and so tend to go elsewhere instead. In order to evaluate the situation a simulation of the Depot has been commissioned. This simulation will simply run with text output describing the events as they occur in the Depot, and collect a minimal amount of statistical data.

Intention of assignment

Even if valuable to the owner, the simulation is not the main purpose of this assignment - indeed, if so was the case there are much better techniques for simulating than writing a concurrent program.

The requirement of this assignment is to write a program in which synchronization and communication takes place between several concurrent processes. It is intended to force you to solve (and not simply avoid) a range of interesting synchronisation problems.


Case Study – Bus Depot Management

You have been tasked to automate the task of Luxury Coach Bus depot management system. The depot employs several mechanics and a number of part time cleaners. The Depot only has 1 single lane ramp to enter and exit the facility, which causes some traffic flow issues as the large busses take 30 seconds to enter and 30 seconds to exit the ramp.  Bus depots have three main tasks as a bus approaches the depot, all of which must be carried out as quickly as possible:



*******************************Basic Requirements******************************


Ensure that the buses do not collide with another bus on the single lane ramp.

Ensure that the approaching bus is inserted smoothly into the traffic around the depot, with a minimum of disruption to the path of other buses.

Guide the bus onto the entrance ramp, again with a minimum of disruption to the rest of the traffic around the depot.

Once a bus obtains clearance to enter, it should enter the ramp, coast to the assigned bay, and park at the appropriate bay, allow cleaners to commence cleaning or mechanic to service the engine, coast to the departure area and exit the ramp.

The following should be configurable:

Number of buses arriving for the day

Number of cleaners

Number of mechanics

Time taken to perform each task


*****************************Additional Requirements***************************


Special cases, such as buses experiencing mechanical malfunctions, or fuel shortages, must be dealt with.

Changing weather conditions must be taken into account, as washing cannot take place if it is raining.

Buses which are deemed dirty by the mechanic will be sent to the cleaning bays.

The depot will inform buses which arrive 30 minutes before closing time to return tomorrow.

The Statistics

At the end of the simulation, i.e. when all other processes have terminated cleanly, the depot manager should do some sanity checks of the Depot and print out some statistics on the run. The result of the sanity checks must be printed. You must  

Check that all bays are indeed empty.

Print out statistics on

oMaximum/Average/Minimum waiting time for a bus.

oNumber of buses served.


*********************************Bonus***************************************

Mini busses sometimes enter the depot, but only require half the time to cross the ramp and 2 mini busses can fit into 1 bay of a regular bus.

A mini bus should implement inheritance of a super class.

(5 Bonus Marks)


*****************************************************************************

A typical workflow is provided below:


Implementation

You should implement your simulation in Java.  Caution!

It might be tempting to use the Thread.interrupt() method to wake sleeping processes. This is a bad idea. Firstly, we have seen what a mess people can get into with this! Secondly, a behaviour which is present in every execution of the program is not exceptional, and is usually considered bad programming style to use an exception in such cases. In summary, don't use Thread.interrupt().

Sample Output

Thread-Bus 3 : 21.40: Bus 3 Request for entrance.

Thread-Bus 2: 21.50: Bus 2: I have cleared the ramp, Goodbye!

main: 21.50: Depot: Ramp available. Next bus please!

Thread- Bus 3 : 21.51: Bus 3 request entrance on Ramp.

Thread- Bus 3: 21.53: Bus 3: Acquiring Ramp!

Thread- Bus 3: 21.54: Bus 3: I’m on the ramp now.

Thread- Bus 3: 21.53: Bus 3: Ok I’ve cleared the ramp!

main: 21.55: Depot: Bus 3 you are clear to proceed to waiting bay.

Thread- Bus 3 : 21.58: Bus 3: I need an oil change!

Documentation

The documentation should contain the following:

Introduction which states your assumptions and describes the flow of activities in the simulation.

Explanations of concurrency concepts (atomic statements, synchronization, etc) implemented with relevant code snippets.

Explanation on sections of codes which you spent most time (include code extracts) on and also include discussion of section that did not work as expected.

Describe any modifications, assumptions and basic design decisions that have been made about the behavior of the various components of the simulation.

Reporting of appropriate tests of program execution


MARKING SCHEME



Criteria

Marks (10 marks for each criteria below)

Excellent

(8-10)Good

(6-7)Average

(5)Poor

(3-4)Very Poor

(0-1)

1.Introduction and background.  [LO1-PO1]

2.Appropriateness of coding techniques used to implement design with appropriate comment lines in source codes   [LO2-PO2]

3.Appropriateness of the Java concurrent programming facilities used. [LO2-PO2]

4.Program runs appropriately with basic requirements. [LO2-PO2]

5.Explanations of concurrency concepts implemented with relevant code samples [LO1-PO1]

6.Additional requirements met. [LO2-PO2]

7.Explanation of the safety aspects of multi-threaded system implemented [LO3-PO3]

8.Justification of encapsulation implemented [LO4-PO6]

9.Reporting of appropriate tests of program execution [LO2-PO2]

10.Depth of discussion – listing of section(s) that did not meet requirements and/or code extracts of sections that met requirements. [LO1-PO1]

SUB-TOTAL


Total Marks



版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp