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 are given two jugs, a 4-gallon one and a 3-gallon one. Neither has any measuring marker on it. There is a tap that can be used to fill the jugs with water. How can you get exac

A useful tool which is used for specifying the logical properties of a data type is called the abstract data type or ADT. The term "abstract data type" refers to the fundamental ma

floyd warshall algorithm

What will be depth do , of complete binary tree of n nodes, where nodes are labelled from 1 to n with root as node and last leaf node as node n

explain the prims''s algorithm with suitable example?

Q. Let a binary tree 'T' be in memory. Write a procedure to delete all terminal nodes of the tree.       A n s . fun ction to Delete Terminal Nodes from Binary Tree

What do we mean by algorithm? What are the characteristics of a good and relevant algorithm? An algorithm is "a step-by-step procedure for finishing some task'' An algorithm c

explain implementation of circular queue insert,delete operations

what is the difference between data type and abstract data type