Difference between revisions of "CSC352 Game of Life in Map-Reduce"

From dftwiki3
Jump to: navigation, search
(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      "          "

Revision as of 15:52, 2 April 2017

--D. Thiebaut (talk) 16:47, 2 April 2017 (EDT)



...