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

Define stack lifo, A stack is a last in, first out (LIFO) abstract data typ...

A stack is a last in, first out (LIFO) abstract data type and sequential data structure. A stack may have any abstract data type as a component, but is characterized by two fundame

Which sorting algorithms not have running time of o (n2), Which sorting al...

Which sorting algorithms does not have a worst case running time of  O (n 2 ) ? Merge sort

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 ?

ERM, Hi, can you give me a quote for an E-R diagram

Hi, can you give me a quote for an E-R diagram

Explain open addressing, Open addressing The easiest way to resolve a c...

Open addressing The easiest way to resolve a collision is to start with the hash address and do a sequential search by the table for an empty location.

Queue, algorithm for insertion in a queue using pointers

algorithm for insertion in a queue using pointers

Example of single node with multiple elements, The class Element represents...

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 hea

Pre-order and post order traversal of a binary tree, The pre-order and post...

The pre-order and post order traversal of a Binary Tree generates the same output. The tree can have maximum One node

Infix expression to postfix form using the stack function, Q. Convert the f...

Q. Convert the following given Infix expression to Postfix form using the stack function: x + y * z + ( p * q + r ) * s , Follow general precedence rule and suppose tha

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