What should be modeled as threads

Assignment Help Data Structure & Algorithms
Reference no: EM13976720

Overview

In this project, you will require to develop a "back end" of a simple game simulation. No graphical output is required. All output should be stored in a (textual) log file.

In this game, we have: one dragline excavator, two trains, and one power plant. The dragline excavator consumes power cells and produces coal; power plant consumes coal and produces power cells; train consumes power cells and can transport both coal and power cells between excavator and power plant, respectively.

Specification

• Dragline Excavator (1x)

o Consumption: 2 power cells

o Production: 1 coal

o Storage for power cells:
- Max: 30 units
- Initial value: 10 units

o Storage for coal
- Max: 15 units
- Initial value: 5 units

• Power plant (1x)

o Consumption: 1 coal

o Production: 5 power cells

o Storage for power cells:
- Max:50 units
- Initial value: 10 units

o Storage for coal
- Max: 20 units
- Initial value: 10 units

• Train (2x)

o Consumption (from fuel cell tank): 1 fuel cell per one-way trip

o Capacity of fuel tank: 5 power cells

o Carrying capacity: 10 units of either coal or power cells (cannot be mixed!)

Part-1 (Individual Assignment)

Analyze proposed game and answer following questions:

• What should be modeled as threads?

• What should be modeled as variables? Which of them should be global (shared) and which can be local?

• What problems can occur in this game? (List all instances and be specific)

• What constructs can be used to prevent these problems?

Reference no: EM13976720

Questions Cloud

Explain how each process may harm living things : Many people confuse the large void in the ozone layer with global warming. Can you distinguish between the two phenomena? Discuss the causes of each. Explain how each process may harm living things. Response should be at least 200 words in length.
Issuance of the bonds at a premium : BONDS ISSUED AT A PREMIUM-Wang Corporation issued the following bonds ata premium:
Explain blackbody radiation using examples : Study Question Title: Blackbody Radiation, Explain blackbody radiation, using examples. Using the textbook and the internet, research blackbody radiation
Can ship make the roundtrip back to home in less time : If a ship enters each ergosphere and goes out into the next one, can it make the roundtrip back to home in less time than 2d/c (home local time)?
What should be modeled as threads : What should be modeled as variables? Which of them should be global (shared) and which can be local? What problems can occur in this game? (List all instances and be specific)
Perspective of negative and positive impact on society : Look at the findings - both from a perspective of negative and positive impact on society? Did the findings have a negative impact? How? Why? Or Why not
Explain the steps in creating a market research : List and explain the steps in creating a market research or feasibility study. Do not go into detail over forecasting, but give some explanation of how to progress through the steps
Explain the control procedures and security strategies : With specific reference to the company's accounting information system, critically evaluate the type and nature of both the risks and the security threats such a company faces in today's business environment and explain the control procedures and ..
Tax research memo identifying the relevant facts : Write a tax research memo identifying the Relevant Facts, Issues Identified, Conclusions, and Authorities and Reasoning for the tax problem listed below. Apply at least one relevant court case.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  How to analyse spectrum of a digital signal using dft method

To learn how to analyse spectrum of a digital signal using DFT method. To learn how to perform I/O operations using interrupt method and program/implement them using the evaluation toolkit

  A sorting algorithm is described as stable

A sorting algorithm is described as stable if equal elements are in the same relative order in the sorted sequence as in the original sequence.

  Implement the queue data structure

implement the queue data structure - circular linked list to implement the queue data structure as described in java.

  Definiteness is one of the properties of an algorithm

Using suitable word or phrase fill up the blanks in the following sentences.

  Homogeneous array

Assume that a homogeneous array with six rows and eight columns, is stored in row major order starting at address 20. If each entry in the array requires only one memory cell.

  What is a race condition in software

What is a race condition in software? Why are race conditions difficult to debug?

  Discuss fault tolerance approaches that systems managers use

Discuss fault tolerance approaches that systems managers use to assure continuity of operations

  Write psuedocode for classic traversal algorithms

Write psuedocode for one of the classic traversal algorithms(preorder, inorder, and postorder) for binary trees. Assuming that your algorithm is recursive, find the number of recursive calls made

  Create an algorithm to describe how to balance a checkbook

Create an algorithm to describe how to balance a checkbook for a company that has more than 100transactions.

  Computing total number of keys needed in symmetric cipher

Determine the total number of keys that are needed for organization if symmetric cipher is used.

  Compute a shortest-path

Compute a shortest-path from u to v (instead of from u to all the nodes). One way to speed up Dijkstra's algorithm might be to run the algorithm u and from v at the same time.

  Prove dijkstras token ring reaches legitimate con­figuration

Prove that Dijkstra's token ring reaches a legitimate con­figuration in O(N2) steps. Shorten the analysis by giving a single norm function, quadratically bounded in N, that decreases with every step of the algorithm.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd