Skip to Content
Technical Articles

simulation based on cellular automaton

Dear community, I had a look at my archive of unpublished developments. Here is one, hope you like it πŸ™‚

The story: Back in 2015, I’ve read the book “Pixelspiele” (it’s written in German). The title could be translated with “Pixel Games”. The book deals with cellular automata. There are interesting examples about the simulation of traffic jam or how a forest fire evolves.

Up to summer 2017, I had no clue what to do with the new knowledge gained from the book. At that time, a lot of people around me began to talk about innovation and the capability to be innovative and how to support the process of being innovative. Afterwards I had the idea to write a simulation in ABAP to show how an innovation is passed on.

As a little note, the simulation has nothing to do with “real” research people doing at university. It’s just a free time project to have fun with ABAP πŸ™‚ Other developers like Christian GΓΌnter wrote an implementation of “conways game of life“, a very popular cellular automaton. So I am not alone with the interest to program such a report.

Here are two screenshots for a first impression (some details at the end of this blog). You can download the souce code from GitHub via abapGit.

 

Simulation description

A number of participants is defined for the simulation. Each participant has two properties with random values between 1% and 100%:

  1. Open-mindedness: This property shows how a participant deals with an innovation. A low value indicates that he will not adopt an innovation.
  2. Communication competence: This property shows if a participant will talk with other participants. A low value indicates that he rather does not talk with other participants.

Each participant has an unique position on the playing field. Other participants around him build his neighborhood. For the simulation, we use the Moore neighborhood.

To start the simulation, a random participant is innovative. This participant is the origin. With every new generation, for every participant will be checked if he can adopt the innovation from his neighborhood. There are three things required:

  1. He must be open-minded.
  2. He must talk with a neighbor who already adopt the innovation.
  3. The neighbor must answer (talk with him).

Implementation

  • The local class “LCL_PROTOCOL” collects all messages.
  • The local class “LCL_ATTENDEES” manages the virtual attendees of the simulation.
  • The local class “LCL_PLAYING_FIELD” does the visualisation (ALV).
  • The local class “LCL_SIMULATION” holds everything together.

Challenges

Following some of my favorite challenges during development and after:

  1. Pack all stuff in one source code file (back then it was easy to copy and I didn’t know abapGit yet πŸ˜‰ ).
  2. Implement a self-refreshing ALV (especially top of page and end of list).
  3. Give every cell an individual tool tip.
  4. Continue developing even if you don’t really have time.
  5. Complete the development after 90%. The last 10% are always hard because there are millions of distractions. Have a look at the free book “IT’S BEHIND YOU: the making of a computer game” of Bob Pape, page 85. He describes it very well πŸ™‚
  6. Rediscover your source code and finally write a blog about it.

Ideas for further development

  1. A new property “oblivion” could be introduced. Every participant has a chance to forget the innovation he adopted from other participants.
  2. This simulation assumes that participants have to talk with their neighborhood. Generally someone can adopt an innovation by watching or listening.
  3. The quality of an innovation can be better or lower when a lot of participants adopt it, a lot of time (generations) passed or the distance from the origin is high.
  4. Conversion to simulate the zombie apocalypse … but some students at the university of Leicester made already a simulation. Therefore no need πŸ˜‰

 

Have fun!

Michael

Be the first to leave a comment
You must be Logged on to comment or reply to a post.