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 and queue, write a algorithsm in c to perform push and pop operation...

write a algorithsm in c to perform push and pop operations stastic implementation using array ?

Algorithms, Write an algorithm to print all even numbers in descending orde...

Write an algorithm to print all even numbers in descending order and draw the flowchart

Breadth-first search , 1. Apply the variant Breadth-First Search algorithm ...

1. Apply the variant Breadth-First Search algorithm as shown in Figure 2 to the attached graph. This variant is used for computing the shortest distance to each vertex from the sta

Conversion of general trees into the binary trees, By taking an appropriate...

By taking an appropriate example explain how a general tree can be represented as a Binary Tree.                                                                    C onversio

Graph connectivity, A connected graph is a graph wherein path exists among ...

A connected graph is a graph wherein path exists among every pair of vertices. A strongly connected graph is a directed graph wherein every pair of distinct vertices is connecte

Areas of use - sequential files, Sequential files are most frequently utili...

Sequential files are most frequently utilized in commercial batch oriented data processing where there is the concept of a master file on which details are inserted periodically. F

Algorithams example, any simple algoritham questions with answers

any simple algoritham questions with answers

Reverse order of elements on a slack, Q. Describe the representations of gr...

Q. Describe the representations of graph. Represent the graph which is given to us using any two methods Ans: The different ways by which we can represent graphs are:

Explain the theory of computational complexity, Explain the theory of compu...

Explain the theory of computational complexity A  problem's  intractability  remains  the  similar  for  all  principal  models  of   computations    and   all reasonable inpu

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