Example of single node with multiple elements, Data Structure & Algorithms

Assignment Help:

The class Element represents a single node that can be part of multiple elements on a hotplate and runs in its own thread. The constructor accepts the initial temperature and a heat constant that should be between 0.0 (exclusive) and 1.0. The start method should start running the thread. While running the element compares the average temperatures of its neighbours with its own temperature and adjusts its current temperature using this formula:

currentTemp += (averageTemps - currentTemp) _ heatConstant

The elements own temperature can be increased or decreased by calling the method applyTempToElement using this formula:

currentTemp += (appliedTemp - currentTemp) _ heatConstant.

Because neighbour elements are running in their own threads and accessing each others temperature, careful synchronization will be needed whenever the temperature field is accessed or changed. Using the UML diagram below as a guide.

2411_elements.png


Related Discussions:- Example of single node with multiple elements

Stack, Explain the array and linked list implementation of stack

Explain the array and linked list implementation of stack

Abstract data type-stack, Conceptually, the stack abstract data type mimics...

Conceptually, the stack abstract data type mimics the information kept into a pile on a desk. Informally, first we consider a material on a desk, where we might keep separate stack

Which are the two standard ways of traversing a graph, Which are the two st...

Which are the two standard ways of traversing a graph? i. The depth-first traversal   ii. The breadth-first traversal

First class Abstract data type , 3. A function to convert a complex number ...

3. A function to convert a complex number in algebraic form to a complex number in phasor form

Process of channel access, Channel access In first generation systems, ...

Channel access In first generation systems, every cell supports a number of channels. At any given time a channel is allocated to only one user. Second generation systems also

Help with Assignment, Need help with Data Structures assignment requiring C...

Need help with Data Structures assignment requiring C++ program

Multikey file organization, what are the applications of multikey file orga...

what are the applications of multikey file organization?

Which sorting methods sorting a list which is almost sorted, Which sorting ...

Which sorting methods would be most suitable for sorting a list which is almost sorted  Bubble Sorting method.

Estimate the probability that the noncritical path , An advertising project...

An advertising project manager developed the network diagram shown below for a new advertising campagign.  In addition, the manager gathered the time information for each activity,

Write Your Message!

Captcha
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