<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Complex Cellular Automata on JCAL Docs</title>
    <link>https://carmelolg.github.io/JCAL/v1.0.0/cca/</link>
    <description>Official documentation for JCAL — Java Cellular Automata Library</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate>Tue, 12 May 2026 20:54:42 +0000</lastBuildDate>
    <atom:link href="https://carmelolg.github.io/JCAL/v1.0.0/cca/index.xml" rel="self" type="application/rss+xml"></atom:link>
    
    
    <item>
      <title>Complex Cellular Automata</title>
      <link>https://carmelolg.github.io/JCAL/v1.0.0/cca/complex-ca/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>https://carmelolg.github.io/JCAL/v1.0.0/cca/complex-ca/</guid>
      <description>&lt;p&gt;A &lt;strong&gt;Complex Cellular Automaton (CCA)&lt;/strong&gt; extends the standard CA model with a
&lt;strong&gt;pre-processing step&lt;/strong&gt; that runs before the transition function reads its neighbors.
This refinement step gives each cell the opportunity to update its internal state
(for example, accumulate incoming flows or decrement a counter) before those updated
values are seen by neighboring cells in the same generation.&lt;/p&gt;
&lt;h2 id=&#34;when-to-use-a-cca&#34;&gt;When to use a CCA&lt;/h2&gt;
&lt;p&gt;Use the refinements hook when:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A cell&amp;rsquo;s next state depends on &lt;strong&gt;accumulated quantities&lt;/strong&gt; that must be resolved
before the transition function is applied (e.g., heat diffusion, lava flow, erosion).&lt;/li&gt;
&lt;li&gt;Your simulation requires cells to perform &lt;strong&gt;bookkeeping between generations&lt;/strong&gt; — such
as decrementing a lifetime counter or normalizing a fractional flow value.&lt;/li&gt;
&lt;li&gt;The transition function alone is insufficient to model the phenomenon correctly.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;data-flow-per-generation&#34;&gt;Data flow per generation&lt;/h2&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;for each generation:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  1. refinements(cell)        — applied to every cell  [optional CCA hook]
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  2. snapshot the grid        — clone the map before any mutation
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  3. singleRun(cell, neighbors) — per cell, reads the snapshot, returns next state
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;  4. copy results back        — update the main map with all new states
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id=&#34;implementing-refinements&#34;&gt;Implementing refinements&lt;/h2&gt;
&lt;p&gt;Override &lt;code&gt;refinements(DefaultCell cell)&lt;/code&gt; in your executor class. Return the modified cell.&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
