⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme~

📁 细胞自动机的一个源代码
💻
字号:
README for config filesthis readme is intended to give a description of the config files used.skip down for some examples.as of now, there are two ca config file types: generic and outer weighted totalistic.for the generic config file, you must specify each rule explicitely.the order of the neighbors constructs the number is base k of the rule, least significantnumber first.  for example, if the neighbors list was:-101for a 1d CA, the rule rule position to use in the rule array would be: f(s_i - 1)*k^0 + f(s_i + 0)*k^1 + f(s_i + 1)*k^2where s_i is the current cellfor outer totalistic, the rules are of the form:f(0, n)*(2^(i*n)) + ... + f(1, n)*(2^(i*n + 1)) + ... + f(k-1, n)*2^((k-1)*n+k-1)the above notation might be a bit wrong but the main thing to take away from it is that itis that the sum is the outer totalistic (wolfram) notation such that the f(0,...)make up the first k+1 positions in the rule, the f(1,...) make up the second k+1 positions and so on.  this makes my life easier when doing lookups.n ranges from 0 to summation of all the weights of the neighbors.  weights of 1for every neighbor are equivalent to straight outer totalistic.  since this isan outer totalistic rule, do not explicitely reference the 0 cell positionin the neighbor list (whereas for generic config you do).since totalistic is a subset of outer totalistic, i have decided not toimplement it.weighted outer totalistic is a bit slower than straight totalistic, but i'vedecided to sacrifice speed for ease of programming and ease of use.  there areprobably quite a few speedups to be done with the lookup, but again, ease ofprogramming, readablity and ease of use are a priority.  if the mood takes me,i'll implement it later.now for the format.# are comments.blank lines ignored.order matters.generic config files:-----------------------------------------------------------------------------------#sample non-totalistic generic config file for rule 54# what type of config file this is (0 == generic, 1 == weighted outer totalistic)0# dimension of CA1# window length (for time series, minimum must be 2)50# CA dimensions (how many cells in each dimension)100# number of neighbors (you must explicitely include the 0 cell if you want it# in your rules)3# neighbors-101# display basis (which access to display cells along)# display along the positive x axis1.0# window (time series) display vector.  (pretty much meaningless for dim>2)# display along0.0 1.0# number of states (alphabet)# binary2# rules (rule 54, least significant bit first)# 000 -> 0, 001 -> 1, 010 -> 1, 011 -> 0 etc...0 1 1 0 1 1 0 0-----------------------------------------------------------------------------------outer totalistic config file sample:-----------------------------------------------------------------------------------# sample weighted outer totalistic config file# this config file describes conways game of life (2/3 sustain, 3 life, death otherwise)1#dim2#win length2#ca dimensions100 100#neigborhood8#neighbors-1 0-1 10 11 11 01 -10 -1-1 -1#weights (straight outer totalistic)1 1 1 1 1 1 1 1#display basis1.0 0.00.0 1.0#window basis0.0 0.0 1.0#number of states2#rules (18)# f(0, 0) = 0, f(0, 1) = 0, f(0, 2) = 0, f(0, 3) = 1 etc...0 0 0 1 0 0 0 0 0 0 0 1 1 0 0 0 0 0 -----------------------------------------------------------------------------------i hope this is pretty straight forward.  i have tried to include some config filegeneration programs so that you won't have to look at this, but it still helps toknow what i'm doing, right?the config file format might be a bit unwieldy (weird rule generation, strict dependence onorder of fields, etc.), but it makes the initialization of the CA much easier to implementwhen the burden of complexity is on the program generating the config file.the routines to read in config files are by no means idiot proof.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -