Difference between revisions of "DPS921 Team Optimize"
(→Serial Implementation) |
|||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Serial Implementation === | === Serial Implementation === | ||
The serial implementation of the above algorithm divides the problem in two three distinct classes. | The serial implementation of the above algorithm divides the problem in two three distinct classes. | ||
Line 69: | Line 9: | ||
* Rule - the class which defines the rule which govern the evolution in every generation. It contains pointers to two world object, the current and the next computed one. | * Rule - the class which defines the rule which govern the evolution in every generation. It contains pointers to two world object, the current and the next computed one. | ||
[[File:rule_class.png|600px|thumb|center|alt| Rule Class ]] | [[File:rule_class.png|600px|thumb|center|alt| Rule Class ]] | ||
+ | |||
+ | ==== Serial Hot Spot ==== | ||
+ | The serial implementation basically applies the rule to every cell in the 2D dimensional matrix, and computes another world determining the position of every cell using the number of neighbours surrounding it. The following loop takes the maximum amount of computation time in determining the position of the cells in the next generation. This will be parallelized in the coming sections. |
Revision as of 20:54, 27 November 2016
Serial Implementation
The serial implementation of the above algorithm divides the problem in two three distinct classes.
- Cellular - the class which defines the cell. It keeps track of the generation, pointer to a world class which defines the dimensions in which the cell exists and a pointer to the rule class which governs the change in the cell on every generation.
- World - the class which defines the world, the environment for the cell in which the cell undergoes evolution. The class contains the dimensions for the 2D dimensional matrix where the cell is positioned.
- Rule - the class which defines the rule which govern the evolution in every generation. It contains pointers to two world object, the current and the next computed one.
Serial Hot Spot
The serial implementation basically applies the rule to every cell in the 2D dimensional matrix, and computes another world determining the position of every cell using the number of neighbours surrounding it. The following loop takes the maximum amount of computation time in determining the position of the cells in the next generation. This will be parallelized in the coming sections.