Difference between revisions of "CSC352 Game of Life in Map-Reduce"
(Created page with "--~~~~ ---- <onlydft> =Data File= <br /> ::<source lang="text"> 0 " " 1 " * " 2 " * " 3 " * " 4 " " <...") |
|||
Line 2: | Line 2: | ||
---- | ---- | ||
<onlydft> | <onlydft> | ||
+ | =Introduction= | ||
+ | <br /> | ||
+ | * We map-reduce once to go from one generation to the next. | ||
+ | * The original array (see Data File section below) is transformed into a file where each line is numbered, and each row of the game of life is sandwiched between double quotes. | ||
+ | * To go from the data file to the first generation: | ||
+ | |||
+ | '''cat life0.txt | ./mapper.py | ./shuffleSort.py | ./reducer.py ''' | ||
+ | 2 4 | ||
+ | 2 5 | ||
+ | 2 6 | ||
+ | |||
+ | : the output is a horizontal line, on Row 2, spanning Columns 4, 5, and 6. | ||
+ | * To generate the second generation: | ||
+ | |||
+ | '''cat life0.txt | ./mapper.py | ./shuffleSort.py | ./reducer.py | ./mapper.py | ./shuffleSort.py | ./reducer.py''' | ||
+ | 1 5 | ||
+ | 2 5 | ||
+ | 3 5 | ||
+ | |||
+ | |||
=Data File= | =Data File= | ||
<br /> | <br /> | ||
+ | The file is called '''life0.txt'''. | ||
::<source lang="text"> | ::<source lang="text"> | ||
0 " " | 0 " " |