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

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

Posted Date: 3/1/2013 4:09:35 AM | Location : United States







Related Discussions:- Example of single node with multiple elements, Assignment Help, Ask Question on Example of single node with multiple elements, Get Answer, Expert's Help, Example of single node with multiple elements Discussions

Write discussion on Example of single node with multiple elements
Your posts are moderated
Related Questions
You need to write a function that performs multiplication of two numbers in your data structure. Again, remember how you multiply numbers in base 10 and you should be fine. Multipl

How many recursive calls are called by the naïve recursive algorithm for binomial coefficients, C(10, 5) and C(21, 12) C(n,k){c(n-1,k)+c(n-1,k-1) if 1 1 if k = n or k = 0

. Create a decision table that describes the movement of inventory

Q. The system allocates the memory for any of the multidimensional array from a big single dimensional array. Describe two mapping schemes that help us to store the two dimensi

Elaborate the symbols of abstract data type length(a)-returns the number of characters in symbol a. capitalize(a)-returns the symbol generated from a by making its first cha

Chaining In this method, instead of hashing function value as location we use it as an index into an array of pointers. Every pointer access a chain that holds the element havi

Question 1 Discuss the advantages of implementation checks preconditions Question 2 Write a ‘C' program to search for an item using binary search Question 3 Show that To

A binary tree is a tree data structures in which each node have at most two child nodes, generally distinguished as "right" and "left". Nodes with children are called parent nodes,

Q. The two Binary Trees are said to be similar if they are both empty or if they are both non- empty and left and right sub trees are similar. Write down an algorithm to determine