Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

A (one dimensional) cellular automaton is a function1 F : Σ → Σ with the property that there is a K > 0 such that F (x)i depends only on the 2K + 1 coordinates xi−K , xi−K+1, . . . , xi−1, xi, xi+1, . . . , xi+K . A periodic point of σ is any x such that σ^p (x) = x for some p ∈ N, and a periodic point of F is any x such that F^q (x) = x for some q ∈ N. Given a cellular automaton F, a point x ∈ Σ is jointly periodic if there are p, q ∈ N such that σ^p (x) = F^q (x) = x, that is, it is a periodic point under both functions.

This project aims to explore the nature of one-dimensional Cellular Automata, in the hope of finding the structure of cellular automata through its periodic points.

2034 views
License: MIT
ubuntu2004
1
/*
2
* Copyright (C) 2004 Bryant Lee
3
*
4
* This file is part of FPeriod.
5
*
6
* FPeriod is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* FPeriod is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with FPeriod; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
/*
22
* RecNode
23
* A record node. Stores information for all the runs for a given period.
24
*
25
* Written by: Bryant Lee
26
* Date: 11/4/04
27
*/
28
29
#ifndef REC_NODE_H
30
#define REC_NODE_H
31
32
#include <map>
33
34
class RecNode {
35
public:
36
unsigned long long currPeriod, numPeriodic, numTrials, largestorbit;
37
unsigned long long sumPeriod, sumPreperiod;
38
39
bool pending;
40
41
map<unsigned long long, unsigned long long>
42
periodMap, // key = eventual pd., value = # points with this pd.
43
preperiodMap, // key = prepd., value = # points with this prepd.
44
orbitMap, // key = pd., value = # orbits with this pd.
45
periodicPeriodMap; //key = pd., value = # periodic points with this pd.
46
47
public:
48
//constructor
49
RecNode(unsigned int icPeriod, unsigned long long iNumTrials);
50
51
//recordOrbit
52
void recordOrbit(unsigned long long iOrbit);
53
54
//recordPeriod
55
//Use this to record points with eventual period "period" and
56
//preperiod "preperiod"
57
void recordPeriod(unsigned long long period, unsigned long long preperiod);
58
59
//recordPeriodicPeriod
60
//Use this to record _periodic_ points with period "period"
61
//This should be done in addition to recordPeriod above
62
void recordPeriodicPeriod(unsigned long long period);
63
64
//fraction periodic
65
double fractionPeriodic();
66
67
//numnonperiodic
68
unsigned long long numNonPeriodic();
69
70
//avgPeriod
71
double avgPeriod();
72
73
//avgPrePeriod
74
double avgPreperiod();
75
76
//maxpreperiod
77
double maxPreperiod();
78
79
//maxperiod
80
double maxPeriod();
81
};
82
83
#endif
84
85