[squeakland] Questions on Kedama

Yoshiki Ohshima yoshiki at vpri.org
Mon Nov 29 03:59:53 EST 2010


At Sun, 28 Nov 2010 19:56:23 -0500,
Steve Thomas wrote:
> 
> Yoshiki,
> 
> I am working on having my son use kedama to model chemical reactions (in particular model varying concentrations of
> vinegar in a solution and how it affects the rate of dissolving of Tums).  So this has provided the incentive to really
> learn Kedama.
> 
>  1. What is the execution model of Kedama. I ask because:
>      1. I tried creating an epidemic using a PDF of yours I found (later realized this was an older version and
>         incorrect) but it had be call an infect script (which turned out not to work, I needed to inline the infect
>         script tiles into a test in the setup script.
>      2. I saw in your project: Particles Epidemic that the "oneStep" script had:
>          1. a set of "Test" tiles that all did the same "test" <villager's:isinfected>
>          2. a tile to that set KedamWorld's:infectedCount<-0
>  2. So in Kedama, does it execute each tile for ALL Turtles at the same time, then execute the next tile for all
>     turtles?

  The basic model still could be considered that for each line of a
script, the execution is synchronized for all turtles in the bleed.
In other words, the line is executed for everybody (as if one by one
for each turtle) and then move onto the next line.

  The tricky part is that the test line has read-write dependency
among turtles.  (I.e., the execution of "KedamaWorld infectedCount
increase by 1" for one turtle affect the test for the next turtle.)

> This would explain (at least in my limited mental model of how Kedama works) as to why you can set
>     KedamWorld's:infectedCount<-0 each time.

  It is still executed once as the line itself does not involve any turtles.
  
>  3. Is there any problem if the "oneStep" script is modified to use only one test (See attached)
>  4. Also In the attached project I point to the set of tiles that were in the earlier PDF in a script, why can't we do
>     this? If my assumption in #2 is correct, that would explain why
>  this does not work.

  The optimization by the compiler cannot see the side-effects done in
another script.  That is why it needs to be inlined.

> Also, in what ways (if any) is the execution model of Kedama different from the execution model in Etoys? (realize this
> is a broad question, but any information that you think may be
> important would be appreciated).

  Yes...  it is a hard question!

-- Yoshiki


More information about the squeakland mailing list