ASSESSMENT 2: PROGRAMMING ASSIGNMENT

Week 10, November 7th

Due: End of Week 4, Sunday 11.59 pm   

Weighting: 40%

Purpose

The purpose of this assessment is to create a fully functional simulation of a more complex system. Building simulations is one of the key objectives of this course. You will need to be able to do this in an industry or government job working in decision sciences. Building a simulation is also the best way to absorb and gain a deep understanding of the ideas and topics that are discussed in this course. Even if you are just managing simulations projects, you should have some experience in creating the simulation itself.

This is quite a large and difficult task, but the assessment will provide considerable structure.

Outcomes

This Task addresses the following Course Learning Outcomes:

  1. Communicate how randomness and controlled variation can be used to model complex systems in a range of application domains such as industry, health, and transportation.
  2. Create a model of a real-world problem specified in words and implement it as a discrete-event simulation.
  3. Validate results from a discrete-event simulation.

Scenario

You will be simulating a factory production line that constructs lawnmowers to order.

The construction process involves a small number of main steps. Each is a series of tasks, but you will only model the main bottleneck task. Presume that the mower is built from a series of prefabricated parts (the engine, the blades, the frame and so on).

The bottleneck in this process is that, in this factory, there is only one machine that can properly fasten the blades to the motor as they have to be attached securely to make them safe.

Unfortunately, the blade-fitting machine is old and breaks down sometimes. If this happens, it is out of service while it is being repaired, and any orders will have to wait.

Assumptions

You should assume the following:

  • Orders for new lawnmowers are processed in a FIFO manner and there can be an unlimited number waiting.
  • Times: all times are independent and
    • the inter-arrival times between orders are independent and exponential with a mean of one hour.
    • the time to construct a lawnmower from parts is deterministic with a time of 45 minutes.
    • the time between breakdowns of the blade-fitting machine is exponential with a mean of two days as measured from the last time it was repaired.
    • the time to fix the machine when it breaks is exponential with a mean time of three hours.
  • There is an unlimited number of parts available to construct new lawnmowers.
  • If the blade-fitting machine breaks down while constructing a lawnmower, the work already completed on that lawnmower is interrupted but ‘saved’. That is, the total time to complete the lawnmower is the construction time, plus any repair times that interrupt construction (it is technically possible that more than one breakdown could occur during the same lawnmower build).

Questions

The factory owner wants to know how to improve their factory, the most obvious change would be to buy a replacement machine to attach the blades. The new machine would break down less often, so the mean time between breakdowns will be

longer. They would like to assess the business case for such a purchase, i.e., what would the reduction in waiting time for orders be, and what percentage of orders would be interrupted with the new machine. Therefore, the questions they would like to answer are:

  • How much production time is lost to repairs?
  • How many lawnmowers have their construction interrupted due to a breakdown and repair?
  • How long do orders wait in this system before being completed, and how much would this be improved if the time between breakdowns was extended?

Your Task

This assessment is scaffolded into three parts:

  • Part 1: Conceptual model (Module 2)
  • Part 2: Functionality (Module 3)
  • Part 3: Programming (Module 4)

The details of each part are outlined in Appendix 1–3 of this brief, and can also be found at the end of Module 2, Module 3 and Module 4 of this course.

Requirements

You will be assessed on three components of this work:

  • Component 1: Conceptual model—your ability to formulate the model.
  • Component 2: Functionality—your ability to write code to create a simulation, and ensure the sub-components of it work.
  • Component 3: Programming style—your ability to write your program according to the specifications and general style guidelines for good code.

You are required to submit:

  • a PDF document showing your schematic, state diagram, flow chart and any other documentation you created.
  • two .jl files with your code for implementing the discrete-event simulation.
  • a pair of data files (an entities and a state file) produced from your simulation with seed=1 and where the simulation was stopped at time T=1000.0.

Consult the assessment rubric when preparing your submission. Questions can be posted to the relevant assessment Discussion Board.

Grading Criteria

This assessment is worth 40% of your overall grade. Refer to the attached rubric for detailed information on the grading criteria for this assessment.

Rubric: Assessment 2: Programming Assignment

Component 1: Conceptual Model
CriteriaRatingsPoints
Task 1 Draw a schematic of the systemPoints: 2.0 Name: Full pointsPoints: 1.0 Name: Partial pointsPoints: 0.0 Name: No points2 pts
Your schematic correctly shows the standard queue components and the breakdown-repair cycle in some way.You have correctly shown either the standard queue components or the breakdown-repair cycle.Assessment requirements for this step have not been met.
Task 2 Describe the state(s) of the systemPoints: 2.0 Name: Full pointsPoints: 1.0 Name: Partial pointsPoints: 0.0 Name: No points2 pts
You have correctly described the state(s) of the system.You have partially described the state(s) of the system.Assessment requirements for this step have not been met.
Task 3 Determine the entities in the system in relation to the statePoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
You have correctly determined the entities in the system.Assessment requirements for this step have not been met.
Task 4 List the types ofPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
events in your model   
   
describe howYou have correctly listed the types of events in your model.Assessment requirements for this step have not been met.
each event   
changes the   
state of the   
system   
describe the   
new events that   
may be created   
as a result of   
this event   
Task 5 Draw a flow chartillustrating yourPoints: 3.0 Name: Full pointsPoints: 2.0 Name: Partial pointsPoints: 1.0 Name: Partial pointsPoints: 0.0 Name: No points3 pts
     
     
simulation structureYour flow chart: (i) is a valid flow chart for this model, (ii) does not have any dead ends (except for the intended termination step); and (iii) includes vacation (machine breakdowns).You have successfully completed two of the following: (i) a valid flow chart, (ii) there are no dead ends (except for the termination step); and (iii) included vacation (machine breakdowns).You have successfully completed one of the following: (i) correctly drawn a valid flow chart, (ii) there are no dead ends (except for the termination step); and (iii) included vacation (machine breakdowns).Assessment requirements for this step have not been met.
Section total:9 pts
Component 2: Functionality
CriteriaRatingsPoints
Task 1 Refine your schematic of the system (see Component 1: Task 1 for marks) 
Task 2 Draw a state-diagram of the systemPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your state diagram shows the correct state transitions.Assessment requirements for this step have not been met.
Task 3 Write code to implement a discrete-event simulation of the system.
Output state file: InitialisationPoints: 2.0 Name: Full pointsPoints: 1.0 Name: Partial pointsPoints: 0.0 Name: No points2 pts
Your initialisation creates a valid starting state with an arrival at time 0.0 and a breakdown at time 150.0.You have done one of the following: (i) created a valid starting state with an arrival at time 0.0, and (ii) created a valid starting state with a breakdown at time 150.0.Assessment requirements for this step have not been met.
Output state file: run! InitialisationPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your run! function can be called with the prescribed inputs and does not crash.Assessment requirements for this step have not been met.
Output state file: Random number generatorsPoints: 4.0 Name: Full pointsPoints: 3.0 Name: Partial pointsPoints: 2.0 Name: Partial pointsPoints: 1.0 Name: Partial pointsPoints: 0.0 Name: No points4 pts
Your random number generators create suitable random numbers for: (i) inter-arrival times, (ii) construction times, (iii) breakdown times, and (iv) repair times.Your random number generators have created suitable random numbers for three of the following: (i) inter-arrival times, (ii) construction times, (iii) breakdown times, and (iv) repair times.Your random number generators have created suitable random numbers for two of the following: (i) inter-arrival times, (ii) construction times, (iii) breakdown times, and (iv) repair times.Your random number generators have created suitable random numbers for one of the following: (i) inter-arrival times, (ii) construction times, (iii) breakdown times, and (iv) repair times.Assessment requirements for this step have not been met.
Output state file: CSV format and metadataPoints: 2.0 Name: Full pointsPoints: 1.0 Name: Partial pointsPoints: 0.0 Name: No points2 pts
Your output state file conforms to the correct CSV format and contains satisfactory metadata.You have done one of the following: (i) created an output state file that conforms to the correct CSV format, (ii) created an output state file that contains satisfactory metadata.Assessment requirements for this step have not been met.
Output state file: StatesPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your output state file contains states that are sequentially ordered in increasing time.Assessment requirements for this step have not been met.
Output state file: Event IDsPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your output state file contains unique event IDs.Assessment requirements for this step have not been met.
Output state file: Arrival and breakdownPoints: 2.0 Name: Full pointsPoints: 1.0 Name: Partial pointsPoints: 0.0 Name: No points2 pts
Your output state file contains an arrival at time 0.0 and breakdown time at 0.0.You have done one of the following: (i) created an output state file that contains an arrival time at 0.0, and (ii) created an output state file that contains a breakdown time at 0.0.Assessment requirements for this step have not been met.
Output state file: QueuePoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your output state file shows that the queue grows during the breakdown.Assessment requirements for this step have not been met.
Output state file: EventsPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your output state file shows that the event list always has 1 or 2 events in it.Assessment requirements for this step have not been met.
Output state file: Machine statusPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your output state file shows that the machine status is 0 normally and 1 after the start of a breakdown up until a repair.Assessment requirements for this step have not been met.
Output entity file: CSV format and metadataPoints: 2.0 Name: Full pointsPoints: 1.0 Name: Partial pointsPoints: 0.0 Name: No points2 pts
Your output entity file conforms to the correct CSV format and contains satisfactory metadata.You have done one of the following: (i) created an output entity file that conforms to the correct CSV format, and (ii) created an output entity file that contains satisfactory metadata.Assessment requirements for this step have not been met.
Output entity file: TimesPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your output entity file contains arrival times, start service times and completion times that are in increasing order.Assessment requirements for this step have not been met.
Output state file: Event IDsPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your output entity file contains entities with unique IDs.Assessment requirements for this step have not been met.
Section total:21 pts
Component 3: Programming Style
CriteriaRatingsPoints
Specification 1 File names, functions and data structuresPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your file names are correct, and the correct code is in the correct place (functions and data structures in particular).Assessment requirements for this step have not been met.
Specification 2 PackagesPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your file names are correct, and the correct code is in the correct place (functions and data structures in particular).Assessment requirements for this step have not been met.
Specification 3 Data structuresPoints: 3.0 Name: Full pointsPoints: 2.0 Name: Partial pointsPoints: 1.0 Name: Partial pointsPoints: 0.0 Name: No points3 pts
You have three data structures declared in a valid manner with appropriate constructors.You have two of the three data structures declared in a valid manner with appropriate constructors.You have one of the three data structures declared in a valid manner with appropriate constructors.Assessment requirements for this step have not been met.
Specification 3 Event typesPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
You have included concrete event types.Assessment requirements for this step have not been met.
Specification 4 Machine breakdownsPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
You have included extra delays for machine breakdowns in the update function for breakdowns.Assessment requirements for this step have not been met.
Specification 5 Update functionsPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
You have included update functions for four types of events.Assessment requirements for this step have not been met.
Specification 6 ParametersPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your code has a data structure for passing parameters.Assessment requirements for this step have not been met.
Specification 7 ConstructorPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
You have included a random number generator constructor.Assessment requirements for this step have not been met.
Specification 7 SpecificationPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
You have included an initialise function matching specification.Assessment requirements for this step have not been met.
Specification 8 run! functionPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
You have included a run! function that runs the simulation.Assessment requirements for this step have not been met.
Specification 9 Entities filePoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your program writes an entities file.Assessment requirements for this step have not been met.
Specification 9 State filePoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
Your program writes a state file.Assessment requirements for this step have not been met.
Specification 10 VariablesPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
You have not included any global variables.Assessment requirements for this step have not been met.
Specification 10 Variable namesPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
You have used meaningful variable names, with the exception of local variables with small scope.Assessment requirements for this step have not been met.
Specification 10 CommentsPoints: 2.0 Name: Full pointsPoints: 1.0 Name: Partial pointsPoints: 0.0 Name: No points2 pts
You have used comments efficiently and effectively.You have partially used comments efficiently and effectively.Assessment requirements for this step have not been met.
Specification 10 White spacePoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
You have used correctly and consistently used indentation and space to separate important components and expressions.Assessment requirements for this step have not been met.
Specification 10 Inefficient approachesPoints: 1.0 Name: Full pointsPoints: 0.0 Name: No points1 pt
You have used correctly and consistently used indentation and space to separate important components and expressions.Assessment requirements for this step have not been met.
Section total:20 pts
Assessment total:50 pts

Appendix 1

Part 1: Conceptual Model

In this part, you will consider the system model that you will be implementing.

The system

You will be simulating a factory production line that constructs lawnmowers to order.

The construction process involves a small number of main steps. Each is a series of tasks, but you will only model the main bottleneck task. You can presume that the mower is built from a series of prefabricated parts (the engine, the blades, the frame and so on).

The bottleneck in this process is that, in this factory, there is only one machine that can properly fasten the blades to the motor as they have to be attached securely to make them safe, so only one lawnmower can be made at once.

Unfortunately, the blade-fitting machine is old and breaks down sometimes. If this happens, it is out of service while it is being repaired, and any orders have to wait.

Assumptions

You should assume the following:

  • Orders for new lawnmowers are processed in a FIFO manner and there can be an unlimited number waiting.
  • Times: all times are independent and
    • the inter-arrival times between orders are independent and exponential with a mean of one hour
    • the time to construct a lawnmower from parts is deterministic with a time of 45 minutes
    • the time between breakdowns of the blade-fitting machine is exponential with a mean of two days as measured from the last time it was repaired
    • the time to fix the machine when it breaks is exponential with a mean of time three hours.
  • There is an unlimited number of parts available to construct new lawnmowers.
  • If the blade-fitting machine breaks down while constructing a lawnmower, the work already completed on that lawnmower is interrupted but ‘saved’. That is, the total time to complete the lawnmower is the construction time, plus any repair times that interrupt construction (it is technically possible that more

than one breakdown could occur during the same lawnmower build).

Questions

The factory owner wants to know how to improve their factory, the most obvious change would be to buy a replacement machine to attach the blades. The new machine would break down less often, so the mean time between breakdowns will be longer. They would like to assess the business case for such a purchase, i.e., what would the reduction in waiting time for orders be, and what percentage of orders would be interrupted with the new machine. Therefore, the questions they would like to answer are:

  • How much production time is lost to repairs?
  • How many lawnmowers have their construction interrupted due to a breakdown and repair?
  • How long do orders wait in this system before being completed, and how much would this be improved if the time between breakdowns was extended?

Tasks for Part 1

Your assessment will require you to write code to simulate the system. However, writing the code can wait until next week when you will have seen more examples and been taught more of the tools required.

This week, before you commence coding you should perform a series of modelling tasks. This week’s tasks will prepare you for Part 2. Some of this week’s tasks will be assigned marks but some will be part of a larger task assigned marks in Part 2 and 3.

  1. Draw a schematic of the system. (2 marks)
  2. Describe the state(s) of the system. (2 marks)

Hint: What state details are needed to answer factory owner’s questions?

  • Determine the entities in the system in relation to the state. (1 mark)
  • List the types of events in your model (1 mark):
    • describe how each event changes the state of the system.
    • describe the new events that may be created as a result of this event.
  • Draw a flow chart illustrating your simulation structure. (3 marks)

At the end of Week 4, you will be required to submit a PDF document showing your schematic, flow chart and responses to these tasks.

Hint: You can create flow charts with the free diagram drawing tool Inkscape, but there are many other tools available for drawing connected series of boxes. Find a

tool you like. Also, your boxes and links don’t have to look exactly the same as mine, but they have to be: (i) clear and readable, and (ii) consistent.

Appendix 2

Part 2

In this part, you will start to program the model.

Reminder

The system to be modelled is described in Part 1.

Tasks for Part 2

  1. Refine your schematic of the system (see Part 1).
  2. Draw a state-diagram of the system. (see Part 1) (1 mark)
  3. Write code to implement a discrete-event simulation of the system.
    • The code will follow the style of the code presented in this module, used to implement the car park model. Use that code as a starting point, but make sure to customise it to this problem or you will get zero marks. (20 marks)
    • The process you need to follow is outlined below under the heading ‘Specification’. (20 marks)

By the end of this part, you should have a working simulation that can output results. In Part 3 you will test it and use it to create some data with a simulation harness.

At the end of Week 4, you will be required to submit a PDF document showing your schematic and state diagram, along with the flow chart from Part 1 and responses to these tasks. You will also be required to submit two .jl files with your code for implementing the discrete-event simulation from Task 3 above.

Specification

This week you will start coding your simulation. I will provide a good deal of the structure for this code because:

  • I want to help. There is a lot written below, but by following it carefully you will get a big start towards developing your simulation.
  • I want to make sure that everyone has a common starting point.
  • I want to make it easier to review and assess your progress by ensuring that everyone adopts the same basic structure for their implementation.

The last point is important. Part of your mark may be based on automated testing of your code. Hence you must set up your code in the manner given. Otherwise, you may lose marks for reasons that could be fixed with little effort.

Here are the required specification details:

  1. Your code must be included in a two stand-alone .jl files. These should be named:
    • factory_simulation.jl
    • factory_simulation_run.jl

The first file should contain all of your data structures and functions. The second file should initialise all variables to values you choose and run the main event loop.

Note that the second file is a temporary file. The second is for your own benefit, for the moment, to test your code. It will be replaced in Part 3 of this assessment with a simulation harness.

(1 mark)

  • You should use the standard packages that you have been using in this course. These include:
    • DataStructures
    • Distributions
    • StableRNGs

You may wish to use a small set of additional packages such as Dates or Printf. Do not use any packages other than these or those that have been discussed in the course.

(1 mark)

  • Your code must specify three data structures:
abstract type Event end mutable struct Entity … mutable struct State …”>

Each will contain fields as required. The state structure should contain any queues or lists required, for instance, the event list.

  • The Event type is an abstract type, which will have more sub-types for each event in your simulation, for instance: Arrival and Breakdown events.
    • The Entity event should contain fields to record important event times in the lifetime of the entity.
    • The State event will, as in the car park simulations, contain a time, event list (queue) and queues for all resources in the system. It will contain other details as needed, such as the state of repair of the machine and the number of events so far.

You should create convenience constructor functions for each of these types, that allow you to create an object when not all of its fields are known. For instance, a function State() that returns an initial system State variable with any required queues or lists created, but empty, and the clock time set to 0.0.

(4 marks)

Note that when the machine breaks down, the time of completion of the current lawnmower will be extended. That is, you need to change the time, i.e. the priority, of the corresponding departure event. You can modify the priority of an object in a priority queue in Julia as follows:

Note that the order of the two items in the queue has swapped. However, be careful if you also store the time of an event in the Event structure because that would not be updated in the code above.

(1 mark)

  • Your factory_simulation.jl code must have a set of update! functions with signatures:

function update!( S::State, R::RandomNGs, E::SomeEvent )

Each update function should process one of your event types so you will need one function per event type.

Each update function should modify the state S appropriately, including

  • adding any new events created from this one
  • moving any entities from queues to servers and so on.

These functions must not have side effects. That is, they should not write out any information to files, or interact with global variables. However, your functions may throw an error if the input is invalid.

These functions need not return anything, but sometimes it is useful for them to return a customer/order entity to the main loop in order to write out information about that.

(1 mark)

  • Your code should have a data structure for passing parameters:

(1 mark)

  • Your factory_simulation.jl code should have an initialise function that takes as input the parameters of the system and returns an initial system state and creates the random number generators you are going to use. In order to make your code easy to extend or modify, you will encapsulate these random number generators into structures that are easy to pass around.
struct RandomNGs rng::StableRNGs.LehmerRNG interarrival_time::Function construction_time::Function interbreakdown_time::Function

Your code will use four random number generators. Store these in another data structure:

rng = StableRNG(P.seed) interarrival_time() = rand(rng, Exponential(P.mean_interarrival)) construction_time() = P.mean_construction_time interbreakdown_time() = rand(rng, Exponential(P.mean_interbreakdown_time)) repair_time() = rand(rng, Exponential(P.mean_repair_time))

Your initialise function should create a set of random number generators to populate the above structure. Create an initialisation constructor function for RandomNGs using code similar to that below (the parameters used here to create these should come from variable P::Parameters).

Note that, although construction times are deterministic, you can use the same functional form to be consistent.

  • The initialisation function should also create a new system state and inject an initial arrival at time 0.0 and initial breakdown at time 150.0 minutes. The function should return the system state and the random number structure.

Therefore, your initialisation function should look like:

function initialise( P::Parameters ) R = RandomNGs( P ) # create the RNGs system = State() # create the initial state structure # add an arrival at time 0.0 t0 = 0.0 system.n_events += 1 # your system state should keep track of # events enqueue!( system.event_queue, Arrival(0,t0), t0) # add a breakdown at time 150.0 t1 = 150.0 system.n_events += 1 enqueue!( system.event_queue, Breakdown(system.n_events, t1 ), t1 ) return (system, R) end

This code presumes you have created appropriate constructors for the random number generators and system state as described above.

(2 marks)

  • Your code should include a run!(state::State, R::RandomNGs, T::Float64, fid_state::IO, fid_entities::IO) function. The inputs are:
    • state: a structure containing the system state;
    • R: a structure of type RandomNGs that contains your random variable generators;
    • T: a floating-point number stating how long to run the simulation
    • fid_state: a file-ID (an IO variable) for the file to which to output your event- based output; and
    • fid_entities: a file-ID (an IO variable) for the file to which to output your entity- based output.

The function should run the main simulation loop for time T. It should remove an event from the event list, call the appropriate function(s) to update the state and write any required output. This should be the function that writes any output when the code is performing correctly, but you may create some utility functions for writing data that are called by run! to make the run! function more readable.

The run! function should return the system state when the simulation finishes. (1 mark)

  • Your code must output two CSV files. The files should both commence with metadata (you can include this using comments preceded with a #).
time,event_id,event_type,length_event_list,length_queue,in_servi ce,machine_status

The first file should contain a time-ordered list of all events that are processed in the simulation. This should be written from the point of view before the event, for instance, you should report the system that an arriving customer sees immediately prior to their arrival. The CSV file should have columns titled:

  • The second file should contain a list of all entities that have completed service. The CSV file should have columns titled:

id,arrival_time,start_service_time,completion_time,interrupted                                                     

You will need to write and construct these CSV files line by line, but you can do this using either the CSV or the Printf package or using raw print statements.

(2 marks)

  • Your code must be written with good style. See Julia’s style guidelines for information, but in particular:
    • avoid global variables wherever possible (1 mark)
    • choose good variable names (1 mark)
    • use comments efficiently and effectively (2 marks)
    • use white space well (1 mark)
    • avoid very inefficient approaches (1 mark).

You should use your factory_simulation_run.jl to run this code and construct some tests. More detail of running the code and testing it will follow in Part 3.

Appendix 3

Part 3

In this part, you will test your implementation and make sure it can output results.

Reminder

The system to be modelled is described in Part 1 and builds on the code written in Part 2.

At the end this week, you will be required to submit:

  • a PDF document showing your schematic, state diagram, flow chart and responses to tasks in Part 1 and Part 2
  • two .jl files with your code for implementing the discrete-event simulation
  • a pair of data files (an entities and a state file) that you have produced from your simulation with seed=1 and where the simulation was stopped at time T=1000.0. Your tutor will check that these files came from your simulation.

When marking your assessment, your tutor will check the output of your code by running the code that you submit. This is the code you created in Part 2 and which you will now refine by completing the tasks outlined here.

Tasks for Part 3

Although you might not need to modify the code in factory_simulation.jl, you may need to modify it in response to bugs found in testing. The main tasks will be to verify that your code works correctly (as described in Module 3: Verification), and to construct a small simulation harness in which to run a set of comparison simulations (as described in Module 4: Tools to Automate Simulation). Following these steps will help ensure you get the maximum number of marks for the code you have written.

  • Test and verify your code.

When I run my version of this code with seed=1 for T=1000.0 minutes, I get the following sort of output:

  • The start of the state file showing the event-based output is as follows:
# file created by code in factory_simulation.jl
# file created on 2021-07-28 at 14:54:36
# parameter seed = 1
# parameter mean_interarrival = 60.0
# parameter mean_construction_time = 25.0
# parameter mean_interbreakdown_time = 2880.0
# parameter mean_repair_time = 180.0
40.499,3,Arrival,1,0,0,0
51.694,6,Arrival,2,0,1,0
65.499,7,Departure,2,1,1,0
90.499,10,Departure,2,0,1,0
117.235,8, Arrival,1,0,0,0
142.235,13,Departure,2,0,1,0
150.000,2,Breakdown,1,0,0,0
182.987,12, Arrival,1,0,0,1
# file created by code in factory_simulation.jl
# file created on 2021-07-28 at 14:54:36
# parameter seed = 1
# parameter mean_interarrival = 60.0
# parameter mean_construction_time = 25.0
# parameter mean_interbreakdown_time = 2880.0
# parameter mean_repair_time = 180.0 id,arrival_time,start_service_time,completion_time,interrupted 1,0.0,0.0,25.0,0 2,40.49940643026974,40.49940643026974,65.49940643026974,0 3,51.69359364153775,65.49940643026974,90.49940643026974,0 4,117.2350182717608,117.2350182717608,142.2350182717608,0

o The start of the entity file showing a list of entities with information output on departure is as follows:

  • Create a test harness that will:
    • run your code for 100 different seed values ranging from 1–100
    • run your code for a set of parameters specified in the following CSV file:
# parameters mean_interarrival,mean_construction_time,mean_interbreakdown_tim e,mean_repair_time 60.0,25.0,2880.0,180.0 “>

From these outputs, you would be able to inform the factory owner about their questions. Although you won’t need to answer these questions specifically, this next stage that you would take in the process will be addressed in Assessment 3.

Test Data

In order to help you test your program, I have provided some example output files.

  • state.csv
  • entities.csv
  1. If you have implemented your code exactly as I have specified, and used the same seed and random number generation, your output should look very, very similar (the only differences should be in details such as numbers of decimal points, white-spacing, or units such as hours or minutes).
  2. However, your code may result in some differences. Some are important and others less so. You need to be quite analytical to understand which. That is, what differences occur because of a minor change in the order of actions, and what differences are caused by bugs. If there are differences, you should create some of your own tests to understand what is different from my code.

Note that you can see the metadata in the files, and from that determine any parameters used.

Order Now

Get expert help for ASSESSMENT 2: PROGRAMMING ASSIGNMENT and many more. 24X7 help, plag-free solution. Order online now!

Universal Assignment (March 16, 2026) ASSESSMENT 2: PROGRAMMING ASSIGNMENT. Retrieved from https://universalassignment.com/assessment-2-programming-assignment/.
"ASSESSMENT 2: PROGRAMMING ASSIGNMENT." Universal Assignment - March 16, 2026, https://universalassignment.com/assessment-2-programming-assignment/
Universal Assignment October 18, 2022 ASSESSMENT 2: PROGRAMMING ASSIGNMENT., viewed March 16, 2026,<https://universalassignment.com/assessment-2-programming-assignment/>
Universal Assignment - ASSESSMENT 2: PROGRAMMING ASSIGNMENT. [Internet]. [Accessed March 16, 2026]. Available from: https://universalassignment.com/assessment-2-programming-assignment/
"ASSESSMENT 2: PROGRAMMING ASSIGNMENT." Universal Assignment - Accessed March 16, 2026. https://universalassignment.com/assessment-2-programming-assignment/
"ASSESSMENT 2: PROGRAMMING ASSIGNMENT." Universal Assignment [Online]. Available: https://universalassignment.com/assessment-2-programming-assignment/. [Accessed: March 16, 2026]

Please note along with our service, we will provide you with the following deliverables:

Please do not hesitate to put forward any queries regarding the service provision.

We look forward to having you on board with us.

Most Frequent Questions & Answers

Universal Assignment Services is the best place to get help in your all kind of assignment help. We have 172+ experts available, who can help you to get HD+ grades. We also provide Free Plag report, Free Revisions,Best Price in the industry guaranteed.

We provide all kinds of assignmednt help, Report writing, Essay Writing, Dissertations, Thesis writing, Research Proposal, Research Report, Home work help, Question Answers help, Case studies, mathematical and Statistical tasks, Website development, Android application, Resume/CV writing, SOP(Statement of Purpose) Writing, Blog/Article, Poster making and so on.

We are available round the clock, 24X7, 365 days. You can appach us to our Whatsapp number +1 (613)778 8542 or email to info@universalassignment.com . We provide Free revision policy, if you need and revisions to be done on the task, we will do the same for you as soon as possible.

We provide services mainly to all major institutes and Universities in Australia, Canada, China, Malaysia, India, South Africa, New Zealand, Singapore, the United Arab Emirates, the United Kingdom, and the United States.

We provide lucrative discounts from 28% to 70% as per the wordcount, Technicality, Deadline and the number of your previous assignments done with us.

After your assignment request our team will check and update you the best suitable service for you alongwith the charges for the task. After confirmation and payment team will start the work and provide the task as per the deadline.

Yes, we will provide Plagirism free task and a free turnitin report along with the task without any extra cost.

No, if the main requirement is same, you don’t have to pay any additional amount. But it there is a additional requirement, then you have to pay the balance amount in order to get the revised solution.

The Fees are as minimum as $10 per page(1 page=250 words) and in case of a big task, we provide huge discounts.

We accept all the major Credit and Debit Cards for the payment. We do accept Paypal also.

Popular Assignments

Assignment Quantitative CASP RCT Checklist

CASP Randomised Controlled Trial Standard Checklist:11 questions to help you make sense of a randomised controlled trial (RCT)Main issues for consideration: Several aspects need to be considered when appraising arandomised controlled trial:Is the basic study design valid for a randomisedcontrolled trial? (Section A)Was the study methodologically sound? (Section B)What are

Read More »

Assignment Qualitative CASP Qualitative Checklist

CASP Checklist: 10 questions to help you make sense of a Qualitative researchHow to use this appraisal tool: Three broad issues need to be considered when appraising a qualitative study:Are the results of the study valid? (Section A)What are the results? (Section B)Will the results help locally? (Section C) The

Read More »

Assignment Topics

PS3002 Assignment TopicsDear studentsPlease choose one of the topics below. Please note that if you are repeating this subject, you cannot choose the same topic that you did previously in this subject.patellar tendinopathyinstability of the lumbar spinehamstring strainperoneal tendinopathyhip – labral tear.hip osteoarthritispatellofemoral instabilityankylosing spondylitisanterior cruciate ligament rupture (conservative management)quadriceps

Read More »

Assessment 2 – Report

Assessment 2 – Report (1200 words, 30%)PurposeTo demonstrate an understanding of the purpose and application of evidence-based dietary advice and guidelinesLearning objectives1.Review and analyse the role and function of macronutrients, micronutrients and functional components of food in maintaining health2.Understand digestion, absorption and metabolism of food in the human body and

Read More »

Assessment 2 – Individual Case Study Analysis Report

Southern Cross Institute,Level 2, 1-3 Fitzwilliam Street, PARRAMATTA NSW 2150 & Level 1, 37 George Street PARRAMATTA NSW 2150Tel: +61 2 9066 6902 Website: www.sci.edu.auTEQSA Provider No: PRV14353 CRICOS Provider No: 04078ªPage 1 of 16HRM201 Human Resources ManagementSemester 1, 2026Assessment 2 – Individual Case Study Analysis ReportSubmission Deadline: This Week,

Read More »

ASSESSMENT 2 BRIEF HPSYSD101 The Evolution of Psychology

HPSYSD101_Assessment 2_20240603 Page 1 of 7ASSESSMENT 2 BRIEFSubject Code and TitleHPSYSD101 The Evolution of PsychologyAssessment TaskAnnotated BibliographyIndividual/GroupIndividualLength2,000 words (+/- 10%)Learning OutcomesThe Subject Learning Outcomes demonstrated by successful completion of the task below include:b) Examine the significant figures, events and ideas present in the history of psychology.c) Identify and relate the

Read More »

Assessment 1 – Individual Case Study Analysis Report

HOS203 Contemporary Accommodation ManagementSemester 1, 2026Assessment 1 – Individual Case Study Analysis Report (10%)Submission Deadline: This Week, at 11:59 pm (Week 4)Overview of this AssignmentFor this assessment, students are required to analyse an assigned case study about hospitality industry relevant regulations and/or operational and accreditation failures of a hospitality organisation.

Read More »

Assessment Brief PBHL1003FOUNDATIONS OF HEALTH AND HEALTH CARE SYSTEMS

Assessment BriefPBHL1003FOUNDATIONS OF HEALTH AND HEALTH CARE SYSTEMSTitleAssessment 2 TypeEssay Due DateWeek 6 Monday 14 April 2025, 11:59pm AEST Length1000 words Weighting60% Academic IntegrityNO AI SubmissionUse Word Document – submit to Blackboard / Assessments Tasks & Submission / Assessment 2 Unit Learning OutcomesThis assessment task maps to the following Unit

Read More »

Assignment 4 – Intersection Upgrades and Interchange Station Design

CIVL5550: Civil Infrastructure DesignAssignment 4 – Intersection Upgrades and Interchange Station DesignDue: This WeekSubmission Instructions:1.Submit a report of approximately 10 pages, covering the following:Part 1: Intersection Upgrade Design•Propose upgrade schemes for two sign-controlled intersections and one signalized intersection•Use SIDRA to evaluate the performance of both the original and upgraded intersections•Use

Read More »

Assessment Brief 1

1 of 14Assessment Brief 1Assessment DetailsUnit Code Title NURS2018 Building Healthy Communities through Impactful PartnershipsAssessment Title A1: Foundations of Community Health Promotions ProjectAssessment Type ProjectDue Date Week 4, Monday, 22nd of September 2025, 11:59pm AESTWeight 40%Length / Duration 1200 wordsIndividual / Group IndividualUnit Learning Outcomes(ULOS)This assessment evaluates your achievement of

Read More »

Assignment 1 – Digital Stopwatch

Assignment 1 – Digital StopwatchThis assessment is an individual assignment. For this assignment, you are going to implement the functionality for a simple stopwatch interface as shown above. The interface itself is already provided as a Logisim file named main.circ . Your assignment must be built using this file as

Read More »

Assessment Background Country Profile

BackgroundCountry ProfileKiribati is an island nation situated in the central Pacific Ocean, consisting of 33 atolls2 and reef islands spread out over an area roughly the size of India (see Figure 1).i Yet, Kiribati is also one of the world’s smallest and most isolated country. A summary of Kiribati’s key

Read More »

Assessment 3: PHAR2001 INTRODUCTORY PHARMACOLOGY

PHAR2001 INTRODUCTORY PHARMACOLOGYAssessment 3: Case StudyASSESSMENT 1 BRIEFAssessment Summary Assessment titleAssessment 3: Case study Due DateThursday Week 6, 17 April at 11:59 Length•The suggested number of words (not a word limit) for the individual questions within the case study is as indicated at the end of each individual question. Weighting50%

Read More »

Assessment Module 1 Healthcare Systems Handout

Module 1Healthcare Systems HandoutGroup AgendasHealth Professionals: You got into health to help people. However, as an owner and operator of a multidisciplinary practice, you need to see many patients to cover the cost of equipment, technology, office and consumables, and pay your staff. The Medicare benefit doesn’t cover the rising

Read More »

Assessment 2 – Case study analysis 

Assessment 2 – Case study analysis  Description  Case study analysis  Value  40%  Length  1000 words  Learning Outcomes  1, 2, 3, 4, 5, 6, 7  Due Date  Sunday Week 9 by 23:59 (ACST)  Task Overview  In this assessment, you will choose ONE case study presenting a patient’s medical history, symptoms, and relevant test

Read More »

Assessment NURS2018: BUILDING HEALTH COMMUNITIES

NURS2018: BUILDING HEALTHCOMMUNITIES THROUGH IMPACTFULPARTNERSHIPSAssessment 1 Template: Foundation of Community Health Promotion projectOverall word count excluding the template wording (63 words) and reference list:Introduction to health issue:The case study, increase breast screening in Muslim women living in Broadmeadows,Melbourne, focuses on addressing the low participation rates in breast cancer screening amongMuslim

Read More »

Assessment EGB272: Traffic and Transport Engineering (2025-s1)

EGB272: Traffic and Transport Engineering (2025-s1)ashish.bhaskar@qut.edu.auPage 1 of 8Assessment 1A (15%) Cover PageIndividual component: 5%Group component: 10%You are expected to submit two separate submissions:Individual Submission (5%): Each student must submit their own individual report. Details of the individual report are provided in Section 3.1, and the marking rubric is in

Read More »

Assessment 3 – Essay: Assessment 3 Essay rubric

Unit: NUR5327 – Management and leadership in healthcare practice – S1 2025 | 27 May 2025Assessment 3 – Essay: Assessment 3 Essay rubricLearning Objective 5:Differentiate drivers forchange and proactively leadhealth professionalresponses to changing anddynamic environmentsFails toidentify aclear plannedchange ordoes not linkit to thestrategic plan.0 to 7 pointsIdentifies aplannedchange, butthe link

Read More »

Assessment 2 – Case study analysis 

Assessment 2 – Case study analysis  Description  Case study analysis  Value  40%  Length  1000 words  Learning Outcomes  1, 2, 3, 4, 5, 6, 7  Due Date  Sunday Week 9 by 23:59 (ACST)  Task Overview  In this assessment, you will choose ONE case study presenting a patient’s medical history, symptoms, and relevant test

Read More »

Assessment 1 PPMP20009 (Leading Lean Projects)

Term 1, 2025PPMP20009 (Leading Lean Projects)1Assessment 1 – DescriptionAssessment title Case study reportAssessment weight 40% of the unit marksReport length 3000 wordsMaximum 8 pages excluding references and appendicesReport format MS Word or PDFSubmission type IndividualSubmission due by Friday, Week 6Assessment objectiveThe purpose of this assessment item is to help you

Read More »

Assignment Maternity – Paramedic Management

Title-Maternity – Paramedic ManagementCase Study – Home Birth Learning outcomes1. Understand the pathophysiology and prehospital management of a specific obstetric condition.2. Develop a management plan for a maternity patient.3. Examine models of care available for maternity patients.4. interpret evidence that supports paramedic care of the maternity patient and neonate.5. Demonstrate

Read More »

Assignment Guidelines for Cabinet Submissions

Guidelines for Cabinet SubmissionsGENERALThe purpose of a Cabinet submission is to obtain Cabinet’s approval for a course of action. Ministers may not have extensive technical knowledge of the subject matter -and may have competing calls on their time. It is, therefore, important that Cabinet submissions are presented in a consistent

Read More »

Assignment Secondary research structure

Dissertation – Secondary Research – Possible Structure and Content GuideA front cover stating: student name, module title, module code, Title of project moduleleader, supervising tutor and word count.Abstract (optional and does not contribute to your word count)This should be an overview of the aim of the critical review, the methodology

Read More »

Assignment E-Business and E-Marketing

Module HandbookFaculty of Business, Computing and DigitalIndustriesSchool of Business(On-campus)E-Business and E-MarketingModule.2025-26􀀀Contents Module Handbook 1Contents 2Module Introduction 3Module Leader Welcome 3Module Guide 5Module Code and Title 5Module Leader Contact Details and Availability 5Module Team Tutors Contact Details and Availability 5Module Teaching 5Module Intended Learning Outcomes 5Summary of Content 6Assessment and Deadlines

Read More »

Assignment II: Computational Fluid Dynamics (CFD) Analysis of

CRICOS Provider 00025B • TEQSA PRV12080 1MECH3780: Computational MechanicsAssignment II: Computational Fluid Dynamics (CFD) Analysis ofGeneralised Cardiovascular Medical DevicesIntroduction:In this assignment, you will develop your CFD capability by analysing a benchmark casefrom a validation study sponsored by the U.S. Food & Drug Administration (FDA) and fundedby the FDA’s Critical Path

Read More »

LCRM301 Researching criminology

LCRM301 Researching criminology Worksheet 1 This worksheet will be disseminated to students in Week 3 and will assist them in the planning and development of the second assessment task: literature review. PART 1: Refining your topic The topic I am interested in is: I am interested in this topic because:

Read More »

ASSESSMENT TASK 2 – COURT APPLICATION

APPENDIX B: ASSESSMENT TASK 2 – COURT APPLICATION (30% OF FINAL MARK)General informationThis Assessment task is worth 30 marks of your final mark.The task is either making (Applicant) or opposing (Respondent) an application before the Supreme Court in your respective state based on a fact scenario, which will be uploaded

Read More »

Can't Find Your Assignment?