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

  Show the postfix expressions

An infix expression is one in which operators are located between their operands - Pop the stack elements and add them to the queue (PostQueue) one by one until the top of the stack has an element of lower precedence

  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.

  Create greedy algorithm to find market to buy apples

Assume we drive pickup truck from city A to city B. Along high way, we will go through n apple markets, labeled with 1, 2, ..., n, where you can buy or sell apples. which means you buy and sell apples at the same market i.

  The traveling salesman problem is a somewhat misleading

The traveling salesman problem (TSP) is a somewhat misleading title as it does not always relate to a salesman.

  Write a procedure hamming

Write a procedure hamming(ascii, encoded) that converts the low-order 7 bits of ascii into an 11-bit integer codeword stored in encoded.

  Js code to prompt the user for integer and print result

Write JS code which prompt the user for an integer and prints the result.

  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.

  What is object modeling and what are the alternatives

What is OBJECT modeling. What is involved. What are the alternatives

  Display rep and contact as the headings in the two columns

Display Rep and Contact as the headings in the two columns of concatenated field data.

  Single binary search tree

You must store the words and the counts of the words in a single binary search tree and each word occurring in the text can only be stored once in the tree

  Algorithm bubble sort

This project is a great opportunity to express your unique problem solving skills as well as your use of structured logic.

  Create world database using mysql

create World database using MySQL and write a Java or C# or program to access the DB

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