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

Method randomizeCells

src/test/BinaryLatticeTest.java:35–46  ·  view source on GitHub ↗

Custom randomizes the spins

()

Source from the content-addressed store, hash-verified

33 * Custom randomizes the spins
34 */
35 private void randomizeCells() {
36 for(int i = 0; i<size; i++) {
37 for(int j = 0; j<size; j++) {
38 if(j < i) {//Math.random()>0.5) {
39 spinData[i][j] = 1;
40 } else {
41 spinData[i][j] = -1;
42 }
43 }
44 }
45 lattice.setBlock(0, 0, spinData);
46 }
47
48
49

Callers 1

BinaryLatticeTestMethod · 0.95

Calls 1

setBlockMethod · 0.65

Tested by

no test coverage detected