1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
# HPP Lattice gas
#
# J. Hardy, O. de Pazzis, and Y. Pomeau (1973) J. Math. Phys. 14, 470.
#
# The earliest lattice gas model. Later made obsolete by the FHP gas on
# a hexagonal lattice, which has better physical properties.
#
# States following http://pages.cs.wisc.edu/~wylie/doc/PhD_thesis.pdf
#
# Each cell can contain up to 4 particles, each moving in one of the four directions.
# Outgoing directions SENW map onto 4 bits, so W=0001=1, SEW=1101=13, etc.
# Next state is simply the collected inputs, in most cases.
# The exceptions are 5 (EW) and 10 (NS) which get swapped (bounce on collision).
#
# To make the gas useful in Golly's infinite area, I've added reflecting boundary
# states, 16-31. These work in the same way as gas particles (collecting inputs)
# but reverse their direction. Contact: Tim Hutton <tim.hutton@gmail.com>
#
# Sink boundary: (or you can vent to the outside but this way is neater)
# 32
# Source boundary: (haven't really worked out how to use this well yet)
# 33
#
# The HPP gas can also be run using the Margolus-neighborhood emulator in
# Golly (see e.g. Other-Rules/Margolus/BBM.rle) but this CA is neater.
n_states:34
neighborhood:vonNeumann
symmetries:none
# a = any of the gas states
var a={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}
# b = any of the reflecting boundary states
var b={16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31}
# s = has an outgoing south particle
var s={8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31,33}
# Ns = doesn't have an outgoing south particle
var Ns={0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23,32}
# e = has an outgoing east particle
var e={4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31,33}
# Ne = doesn't have an outgoing east particle
var Ne={0,1,2,3,8,9,10,11,16,17,18,19,24,25,26,27,32}
# n = has an outgoing north particle
var n={2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31,33}
# Nn = doesn't have an outgoing north particle
var Nn={0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29,32}
# w = has an outgoing west particle
var w={1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33}
# Nw = doesn't have an outgoing north particle
var Nw={0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32}
# straightforward transport (no interactions) except 5 and 10 which are swapped
a,Ns,Nw,Nn,Ne,0
a,Ns,w,Nn,Ne,1
a,Ns,Nw,n,Ne,2
a,Ns,w,n,Ne,3
a,Ns,Nw,Nn,e,4
a,Ns,w,Nn,e,10
a,Ns,Nw,n,e,6
a,Ns,w,n,e,7
a,s,Nw,Nn,Ne,8
a,s,w,Nn,Ne,9
a,s,Nw,n,Ne,5
a,s,w,n,Ne,11
a,s,Nw,Nn,e,12
a,s,w,Nn,e,13
a,s,Nw,n,e,14
a,s,w,n,e,15
# reflecting boundaries:
b,Ns,Nw,Nn,Ne,16
b,Ns,Nw,Nn,e,17
b,s,Nw,Nn,Ne,18
b,s,Nw,Nn,e,19
b,Ns,w,Nn,Ne,20
b,Ns,w,Nn,e,21
b,s,w,Nn,Ne,22
b,s,w,Nn,e,23
b,Ns,Nw,n,Ne,24
b,Ns,Nw,n,e,25
b,s,Nw,n,Ne,26
b,s,Nw,n,e,27
b,Ns,w,n,Ne,28
b,Ns,w,n,e,29
b,s,w,n,Ne,30
b,s,w,n,e,31
|