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

Link list, algorithm for multiplication of two sparse matrices using link l...

algorithm for multiplication of two sparse matrices using link list

Diophantine Equations, Implement algorithm to solve 5-1 fifth order equati...

Implement algorithm to solve 5-1 fifth order equation given.

Define the internal path length, Define the Internal Path Length The In...

Define the Internal Path Length The Internal Path Length I of an extended binary tree is explained as the sum of the lengths of the paths taken over all internal nodes- from th

Explain insertion sort, Q. Explain the insertion sort with a proper algorit...

Q. Explain the insertion sort with a proper algorithm. What is the complication of insertion sort in the worst case?

The two famous methods for traversing, The two famous methods for traversin...

The two famous methods for traversing are:- a) Depth first traversal b) Breadth first

Algorithms, characteristics of a good algorithm

characteristics of a good algorithm

Computational complexity, Generally, Computational complexity of algorithms...

Generally, Computational complexity of algorithms are referred to through space complexity (space needed for running program) and time complexity (time needed for running the progr

Write an algorithm inputs speed of cars using pseudocode, Write an algorith...

Write an algorithm by using pseudocode which: Inputs top speeds of 5000 cars Outputs fastest speed and the slowest speed Outputs average speed of all the 5000 cars

Algorithm to build a binary tree , Q. Give the algorithm to build a binary ...

Q. Give the algorithm to build a binary tree where the yields of preorder and post order traversal are given to us.

Sort 5, The number of interchanges needed to sort 5, 1, 6, 2 4 in ascending...

The number of interchanges needed to sort 5, 1, 6, 2 4 in ascending order using Bubble Sort is 5

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