Adjust the energy to account for changes in the external field.
()
| 212 | * Adjust the energy to account for changes in the external field. |
| 213 | */ |
| 214 | synchronized void adjustE() { |
| 215 | E -= (newH-H)*M; |
| 216 | H = newH; |
| 217 | fieldChanged = false; |
| 218 | } |
| 219 | |
| 220 | private boolean flip() { |
| 221 | int x = (int) (Math.random()*size); |