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
How To implement stack using two queues , analyze the running time of the stack operations ?

What is bubble sort? Bubble Sort: The basic idea in bubble sort is to scan the array to be sorted sequentially various times. Every pass puts the largest element in its corr

DEPTH FIRST SEARCH (DFS) The approach adopted into depth first search is to search deeper whenever possible. This algorithm frequently searches deeper through visiting unvisite

In this assignment, you are invited to design and implement a software system for catalogue sale. A catalogue is organised in a tree structure. Each node of the catalogue tree repr

what do we use asymptotic notation in study of algorithm?Describe various asymptotic notation and give their significance.

A queue is a particular type of collection or abstract data type in which the entities in the collection are went in order and the principal functions on the collection are the add

Problem 1. Explain about the doubly linked list with neat diagram. Diagram Explaining doubly linked list 2. Explain what are the criteria to be used in evaluatin

#question. merging 4 sorted files containing 50,10,25,15 records will take time?

Draw a flowchart of a Booth''s multiplication algorithm and explain it.

characteristics of a good algorithm