MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / randomizeCells

Method randomizeCells

src/debugging/physicsapps/IsingApp.java:133–145  ·  view source on GitHub ↗

Custom randomizes the spins

()

Source from the content-addressed store, hash-verified

131 * Custom randomizes the spins
132 */
133 private void randomizeCells() {
134 for(int i = 0; i<size; i++) {
135 for(int j = 0; j<size; j++) {
136 if(Math.random()>0.5) {
137 spinData[i][j] = 1;
138 } else {
139 spinData[i][j] = -1;
140 }
141 }
142 }
143 lattice.setBlock(0, 0, spinData);
144 getME();
145 }
146
147 /**
148 * Set the parameters in the calculation.

Callers 3

initMyControlMethod · 0.95
randomizeMethod · 0.95
initializeAnimationMethod · 0.95

Calls 2

getMEMethod · 0.95
setBlockMethod · 0.65

Tested by

no test coverage detected