Class CCASmp
- java.lang.Object
-
- edu.rit.smp.ca.CCASmp
-
public class CCASmp extends java.lang.ObjectClass CCASmp is an SMP parallel program that calculates the evolution of a continuous cellular automaton and stores the result in a grayscale PJG image file. Within each time step, the cells' next states are calculated in parallel by K threads, then the cell's current states are written as one row of the image file by a single thread.Usage: java [ -Dpj.nt=K ] edu.rit.smp.ca.CCASmp C S A B imagefile
K = Number of parallel threads
C = Number of cells (>= 1)
S = Number of time steps (>= 1)
A = Multiplicand in update formula (rational number)
B = Addend in update formula (rational number)
imagefile = Output PJG image file nameThe cellular automaton (CA) consists of an array of C cells. Each cell's value is a rational number in the range 0 to 1. A cell's next value is computed as follows: Compute the average of the cell itself, the cell's left neighbor, and the cell's right neighbor (wraparound boundary conditions); multiply by A; add B; and take the fractional part, yielding a result in the range 0 to 1. The CA's initial state is all cells 0, except the middle cell is 1. The program evolves the CA's initial state for S time steps and generates a grayscale image with S+1 rows and C columns. The first row of the image corresponds to the CA's initial state, and each subsequent row corresponds to the CA's state after the next time step. In the image, each pixel's gray value is proportional to the corresponding cell's value, with 0 being white and 1 being black. The image is stored in a Parallel Java Graphics (PJG) file. For further information about the PJG format, see class PJGImage.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidmain(java.lang.String[] args)Main program.
-
DMelt 3.0 © DataMelt by jWork.ORG