I haven't explored your code, Rob, but both time and space look good:
ts' addrow^:1000 <1' NB. Rob Hodgkinson 2019
0.100705 1.50035e6
ts'(rrule 30) autoevo 1000=i.+:1000' NB. Cliff Reiter ~2004
3.21914 6.63965e7
ts'30 ca 1000' NB. Mike Day ~2004
6.91463 1.89681e7
Hardly worth discussing and showing my "ca" nor Cliff's in view of
their performance!
BTW, it turns out Brian Schott's stuff which I'd called
cellautom.schott. ijs,
for some reason, was nothing to do with Wolfram automata and everything
to do with filling crossword grids!
Cheers,
Mike
On 04/10/2019 22:50, 'Rob Hodgkinson' via Programming wrote:
Mike, Raul thanks for feedback.
I saw the Rosetta code but felt it too slow to investigate the patterns for larger
n, as I wanted to explore n>2,000.
The other general cases are readily adapted by changing the cases and values
too.
ts '''_*'' {~ view addrow^:1000 <1'
0.046833 7.75168e6
ts '(30 Rule =&0@i:)1000'
0.892658 3.52824e7
Even for n=5000 you get a result and best viewed in Viewmat (but viewing detail
is well and truly lost beyond eg 500).
ts 'viewmat view addrow^:5000 <1'
3.07417 2.78932e9 NB. 2 seconds of this is spent in viewmat
ts ‘z=:addrow^:5000 <1'
1.12924 3.81635e7 NB. Algorithm time
I presented this as it may be useful for someone then looking into the random
nature of the central column (Wolfram’s Rule 30 questions) found here using the
diagonal function from
ts 'd=:diagonal >z'
0.01667 6.71188e7
…/Rob
On 5 Oct 2019, at 3:15 am, 'Mike Day' via Programming
<[email protected]> wrote:
We seem to have been discussing this in July 2004, to judge from the
dates of a couple of old scripts in my collection, cellauto.ijs and
cellautom.schott.ijs, which suggests Brian was a correspondent. Cliff
Reiter and Henry Rich are mentioned in the former script....
The top of cellauto.ijs is commented as follows:
NB. For doing simplest kind of cellular automata in
NB. Stephen Wolfram's "New Kind of Science" (2002)
NB. By Kirby Urner, July 18, 2002
No more time to comment now, as about to go out.
Mike
On 04/10/2019 16:42, Raul Miller wrote:
There's also an implementation at
https://rosettacode.org/wiki/One-dimensional_cellular_automata#J
9 Rule 30] 0=i:9
_________#_________
________###________
_______##__#_______
______##_####______
_____##__#___#_____
____##_####_###____
___##__#____#__#___
__##_####__######__
_##__#___###_____#_
Or, if it's rewritten:
Rule=:1 :0 NB. , x: number of generations, m: rule number, y: start state
:
'_#'{~ (3 ((|.m#:~8#2) {~ #.)\ 0,],0:)^:(i.x) y
)
(30 Rule =&0@i:)9
_________#_________
________###________
_______##__#_______
______##_####______
_____##__#___#_____
____##_####_###____
___##__#____#__#___
__##_####__######__
_##__#___###_____#_
Thanks,
--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm