MCPcopy Create free account
hub / github.com/SimHacker/micropolis / n_spinglass

Method n_spinglass

MicropolisCore/src/CellEngine/src/cellengine.cpp:4218–4236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4216
4217
4218void CellEngine::n_spinglass()
4219{
4220
4221#define SPINGLASS ( \
4222 ((((xx + x) ^ (yy + y) ^ phase) & 1) /* spatio-temporal phase */ \
4223 ? c /* stay the same if true */ \
4224 : (((((((n >> 7) ^ (c >> 0)) & 1) + \
4225 (((w >> 7) ^ (c >> 1)) & 1) + \
4226 (((s >> 7) ^ (s >> 0)) & 1) + \
4227 (((e >> 7) ^ (e >> 1)) & 1)) != 2) \
4228 ? (c & 1) /* stay the same if energy != 2 */ \
4229 : ((c & 1) ^ 0x80) /* flip if energy == 2 */ \
4230 ) \
4231 ) \
4232 ) \
4233)
4234
4235 CAM_MASKED_REG_LOOP(SPINGLASS)
4236}
4237
4238
4239static Byte GlassBondsTable[16] = {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected