Langton's ant [gnuplot]

Tuesday, June 2, 2020

Cellular Automaton gnuplot YouTube

t f B! P L

YouTube

 

Simulation [gnuplot]

Rules [1]

Case 1 : Original Langton's ant

Source code (PLT file)

Output (PNG file → GIF file)

Case 2 : Extended Langton's ant

Source code (PLT file) (Rule : RRLLLRLLLRRR)

Output (PNG file → GIF file)


Rule : LLRR

Rule : LRRRRRLLR

Rule : LLRRRLRLRLLR

Rule : RRLLLRLLLRRR

Note : How to draw cells

Using "object rectangle from x1,y1 to x2,y2"

GOOD: Easy to arrange squares

In this way, the size of rectangle is determined by position of vertices. So, you can arrange rectangles in good order by using command "object rectangle" and setting option "from" and "to".

BAD: Slow calculation and image ouput

Processing time for setting objects is long. So, you can't output PNG files fast. ↓ In this article, using object command, I made animation of Conway's game of life.

Using "plot with point pt 4 (or 5) ps pointSize" (this time)

GOOD: Calculate and ouput images fast

In contrast to using object, processing time is short. So, you can output PNG files fast.

BAD: Difficult to adjust cell size (i.e. pointsize)

If you reset the size of png image or the number of the cells Nx or Ny, you have to find proper size of box.

References

  1. ^ Langton's ant - Wikipedia

Search This Blog

Translate

QooQ