You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: garlicsim/docs/intro/tutorial1.txt
+16-9Lines changed: 16 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -307,7 +307,8 @@ node to the tree as a root. The method returned the new node. Let's see some
307
307
info about our node:
308
308
309
309
>>> root
310
-
<garlicsim.data_structures.Node with clock 0, root, leaf, touched, blockless, at 0x1c68ed0>
310
+
<garlicsim.data_structures.Node with clock 0,
311
+
root, leaf, touched, blockless, at 0x1c68ed0>
311
312
312
313
The ``clock 0`` thing means that the clock reading of this node's state is zero.
313
314
The states that will succeed it will have incrementing clock readings. The
@@ -357,7 +358,8 @@ Okay, now that the results of our simulation are ready, let's take a look at our
357
358
tree:
358
359
359
360
>>> project.tree
360
-
<garlicsim.data_structures.Tree with 1 roots, 51 nodes and 1 possible paths at 0x1c68810>
361
+
<garlicsim.data_structures.Tree with 1 roots,
362
+
51 nodes and 1 possible paths at 0x1c68810>
361
363
362
364
Our tree has only one possible :class:`Path <garlicsim.data_structures.Path>` in
363
365
it. A :class:`Path <garlicsim.data_structures.Path>` represents one timeline
@@ -373,14 +375,17 @@ Let's fork our tree. But before that, let's get that single path:
373
375
>>> path
374
376
<garlicsim.data_structures.Path of length 51 at 0x1ccfb30>
375
377
376
-
:class:`Path <garlicsim.data_structures.Path>` is a list-like object. We can get any node we want from it using its index number. Let's see how our diehard is doing at clock 50:
378
+
:class:`Path <garlicsim.data_structures.Path>` is a list-like object. We can get
379
+
any node we want from it using its index number. Let's see how our diehard is
380
+
doing at clock 50:
377
381
378
382
.. _original_clock_50:
379
383
380
384
::
381
385
382
386
>>> path[-1]
383
-
<garlicsim.data_structures.Node with clock 50, leaf, untouched, belongs to a block, crunched with StepProfile(), at 0x1cd9070>
387
+
<garlicsim.data_structures.Node with clock 50, leaf, untouched,
388
+
belongs to a block, crunched with StepProfile(), at 0x1cd9070>
384
389
>>>
385
390
>>>
386
391
>>> path[-1].state
@@ -493,11 +498,13 @@ it can start crunching from that node.
493
498
We can see our tree now has two possible paths:
494
499
495
500
>>> project.tree
496
-
<garlicsim.data_structures.Tree with 1 roots, 52 nodes and 2 possible paths at 0x1c68810>
501
+
<garlicsim.data_structures.Tree with 1 roots,
502
+
52 nodes and 2 possible paths at 0x1c68810>
497
503
498
504
The fork happens on clock 27, since that is the one we duplicated for editing.
499
505
500
-
Now we want to crunch from our new node up to a clock of 50, like in the original timeline:
506
+
Now we want to crunch from our new node up to a clock of 50, like in the
507
+
original timeline:
501
508
502
509
>>> project.ensure_buffer(root, 50)
503
510
@@ -551,9 +558,9 @@ And now, to see what happens in clock 50 in our alternate timeline::
551
558
552
559
>>>
553
560
554
-
This is a very different state from :ref:`the one <original_clock_50>` in the original timeline! It has
555
-
about twice as many live cells. This is a reminder of how a small change in the
556
-
present can cause a big change in the future.
561
+
This is a very different state from :ref:`the one <original_clock_50>` in the
562
+
original timeline! It has about twice as many live cells. This is a reminder of
563
+
how a small change in the present can cause a big change in the future.
0 commit comments