Weasel Program


H. Kemal Ilter
Jun 26, 2015


Weasel program is a good point to start thinking about behavioural evolution of manufacturing companies. Let say -hypothetically- we have a company which is producing some products with a set of tools (i.e. best practices). This toolset includes limited number of tools (say genomes) and called genetic combination. Accordingly, this company is being exist in a limited business environment. The business environment has a limited set of environmental factors (e.g. common industrial best practices' requirements), called environmental set. In each step, the company evolves and try to adapt to the environment. As a beginning, we can imagine that the environment can be in one of two different state in the proposed model of simulation; (1) Environmental set is not changing, it is in a steady state; (2) Environmental set is changing randomly in each step, it is in a transient period. I am going to call these two situations as scenarios.

Scenarios

  1. Environmental set is fixed.
  2. Environmental set is changing over time regardless of the change of the genetic combination. (not shown here)

Algorithm

A "Weasel" style algorithm could run as follows.

  1. Start with a random string of 4 characters. Each character is a member of {A, B, ..., C}.
  2. Make 2 copies of the string (reproduce).
  3. For each character in each of the 2 copies, with a probability of 5%, replace (mutate) the character with a new random character.
  4. Compare each new string with the target string of the Environmental Set, and give each a score (the number of letters in the string that are correct and in the correct position).
  5. If any of the new strings has a perfect score (4), halt. Otherwise, take the highest scoring string, and go to step 2.

Scenario 1
GC¹
Step 1. Child 1. Mutant³ 1. Score 2. Child 2. Mutant 2. Score Reference set
0 ABCD ZZZZ
1 ABCD CZTU 1 ABCD KLOP 0 ZZZZ
2 CZTU LZFG 1 CZTU AWZZ 2 ZZZZ
. . . . . . . .
. . . . . . . .
119 PKTL ZZZZ 4 PKTL ZZJZ 3 ZZZZ
120 ZZZZ 4 ZZZZ

¹ Genetic combination of the company. ² Environmental set. ³ Mutant: Mutated child.

Further Readings

  • Variation (Genetic diversity) = Mutation + Sex and Recombination + Gene flow
  • Mechanisms = Natural selection + Biased mutation + Genetic drift + Genetic hitchhiking + Gene flow
  • Outcomes = Adaptation + Coevolution + Cooperation + Speciation + Extinction

Python Code