Archiv der Kategorie: Wiederholungen

OKSIMO EINFACHE BEISPIELE: Bsp.: Jemand ist hungrig, Teil 4, Verzweigung

OKSIMO – UNIVERSELLE PROZESS PLANUNG
Veröffentlicht: 17.April 2021 – 7.Mai 2021
Email: info@oksimo.org

Autor: Gerd Doeben-Henisch; Email: gerd@oksimo.org

Letzte Änderung: 23.April 2021 (Kleine Korrekturen)

Letzte Änderung: 7.Mai 2021 (Neue Dokumentation, ausführlicher)

Letzte Änderung: 15.Mai 2021 (Verlinkung auf universelle Prozesse planen)

KONTEXT

Dieses Fallbeispiel gehört zur Sektion Einfache Beispiele des Blogs oksimo.org. Später wurde die Sektion universelle Prozesse planen geschaffen mit dem Fokus auf strukturelle Eigenschaften der oksimo Sprache. Das nachfolgende Beispiel würde auch in diese Sektion passen.

Beispiel: Jemand ist hungrig, Teil 4, Verzweigung

Dieses Beispiel ist eine Erweiterung des vorausgehenden Beispiels. Es geht auf den Sachverhalt ein, dass wir im Alltag sehr oft über mehr als nur eine Handlungsmöglichkeit verfügen. Im vorliegenden Fall gibt es mehrere Essens-Bestell-Möglichkeiten unter Corona-Bedingungen: neben dem ‚Griechen um die Ecke‘ kann Gerd auch zur ‚Pizzeria über die Straße‘ gehen. Dies ist ein bisschen weiter und bietet etwas Anderes zum Essen (Steinofen-Pizza).

Verzweigungen sind im oksimo Paradigma ausdrückbar durch das zur Verfügung stellen von mehr als einer Veränderungsregel. Ist die Wahrscheinlichkeit im Einzelfall <=1, dann wird für jeden Wahrscheinlichkeitswert ‚ausgewürfelt‚, was geschieht. Einfach gesprochen: bei einer Wahrscheinlichkeit von π=0.6 würde bei 100 Durchläufen ungefähr +/- 60 mal diese Option gewählt werden, entsprechend bei π= 0.4 ungefähr +/- 40 mal.

Im Beispiel werden für den Akteur ‚Gerd‘ zwei Optionen angenommen: zum Essen kann er entweder zum ‚Griechen um die Ecke‘ gehen oder zur ‚Pizzeria über die Straße‘. Es wird mal angenommen, dass der Akteur eher zum Griechen um die Ecke geht (weil es ’näher‘ ist) mit π=0.6, und entsprechend zur ‚Pizzeria über die Straße‘ mit π=0.4.

Bild: Überblick über das Beispiel Teil 4 mit einer Verzweigung. Das Testprotokoll von einem Simulationslauf zum Beispiel findet sich unten in einem verlinkten PDF.

Erweiterte Dokumentation mit Simulationsformen ‚Entwicklung‘ und ‚Präsentation‘ (Ergänzung: 7.Mai 2021):

ERLÄUTERUNGEN

Verzweigungen

Im einfachen Fall gibt es eine Situation, auf die mehr als eine Regel zugreifen kann. Dann werden diese Regeln alle ausgeführt, aber in einer Abfolge, die per Zufallszahlen erstellt wurde.

Handelt es sich aber um Wahrscheinlichkeiten <= 1, die als exklusiv verstanden werden sollen (also entweder zum Griechen oder zur Pizzeria), dann muss bei der Formulierung der Regeln darauf geachtet werden, dass die möglichen Alternativen explizit ausgeschlossen werden. Lässt man dies aus, dann kann es passieren dass u.a. der Akteur ‚Gerd‘ sowohl zur Pizzeria geht wie auch zum Griechen. D.h. der Akteur wird dann ‚verdoppelt‘.

Im vorgestellten Beispiel sind die Regeln als exklusive Regeln ausgelegt. Dies führt dann dazu, dass (im Protokoll) die Option ‚zum Griechen‘ bei 100 Simulations-Zyklen 10x auftritt und die Option ‚zur Pizzeria‘ 2x. Diese Verhältnisse können sich in jeder Simulation aber ändern.

Simulation, REGELDOKUMENT und REGEL

Die Testsimulation wurde mit Hilfe eines Regeldokuments mit Namen gerdhungrig1234 durchgeführt. Es wurden 100 Zyklen vorgegeben. Man kann dann die gesamte Simulation speichern oder beliebig oft wiederholen oder als Textdatei ausgeben. Im Beispiel wurde eine Simulation gespeichert und diese wurde dann wiederholt neu gestartet. Bei jedem Testlauf ändern sich die Zufallswerte.

Das Regeldokument mit Namen gerdHungrig1234 enthält die folgenden Regeln:

  • GerdWirdHungrig1
  • BestellungGriechen1
  • HungerGestillt4
  • Nachmittag1
  • Morgen1
  • Mittag1
  • GerdWirdHungrigGrieche-0-6
  • GerdWirdHungrigPizza-0-4
  • Bestellung Pizzeria1
  • HungerGestilltPizza1
  • NachmittagPiz1
  • ZumGriechen2-0-6
  • ZurPizzeria1-0-4

Die Regeln selbst sind auf dem vorausgehenden Bild abgebildet.

Man kann Regeldokumente leicht abändern durch Löschen oder Hinzufügen von neuen Regeln.

PFAD-WECHSELWIRKUNGEN

Bei dem Erstellen von Fallbeschreibungen (Ausgangssituation, Vision, und Veränderungsregeln) ist es sehr oft der Fall, dass man mit einer einfachen Beschreibung anfängt, und man dann nach und nach immer mehr Aspekte des Falls erkennt und diese dann noch in die bisherige Beschreibung einbauen will. Im Prinzip ist jede(r) Autor*in ganz frei, wie er/sie dabei vorgehen will. Dabei ist allerdings zu beachten, dass es mit wachsenden Alternativen immer mehr parallele Pfade geben wird. In einer konkreten Simulation wird es zu jedem Zeitpunkt aber immer nur eine Situation S geben, die die aktuelle Situation S ist. Man muss also darauf achten, dass die Bedingungsteile von verschiedenen Regeln, die für verschiedene Pfade gedacht sind, sich auch hinreichend unterscheiden.

OKSIMO EINFACHE BEISPIELE: Bsp.: Jemand ist hungrig, Teil 3, Wiederholungen

OKSIMO – UNIVERSELLE PROZESS PLANUNG
Veröffentlicht: 13.April 2021 – 14.April 2021
Email: info@oksimo.org

Autor: Gerd Doeben-Henisch; Email: gerd@oksimo.org

Letzte Änderung: 14.April 2021

KONTEXT

Dieses Fallbeispiel gehört zur Sektion Einfache Beispiele des Blogs oksimo.org.

Beispiel: Jemand ist hungrig, Teil 3, Wiederholungen

Voraus geht die Einführung in das Beispiel mit jemandem, der Mittags Hunger verspürt, diesen Zustand ändern will, und kurz entschlossen zum ‚Griechen um die Ecke‘ geht. Als er dort etwas essen kann, ist sein Hunger vorbei und das Ziel erreicht.

Wie jeder weiß ist die Sache im realen Leben damit nicht wirklich zu Ende. Der Körper verbraucht Energie und über kurz oder lang kommt das Hungergefühl wieder. Nehmen wir hier vereinfachend mal an, dass dies immer in der Mittagszeit ist. Wie können wir solche Wiederholung im oksimo Paradigma ausdrücken?

Veränderungen können wir grundsätzlich durch geeignete Veränderungsregeln herbeiführen. Eine Regel kann aber nur wirken, wenn sie durch eine Eigenschaft der aktuellen Situation S ausgelöst wird. Also, sie fahren Auto und sehen plötzlich vor sich die Ampel auf rot schalten. Als geprüfter Autofahrer haben sie gelernt, dass sie in solch einem Fall bremsen und ihr Auto zum Halt bringen müssen. Also letztlich war es der Sachverhalt, dass die Ampel von Grün über Orange auf Rot geschaltet hat. Was wäre das Äquivalent in unserem Beispiel. Eine Möglichkeit wäre die Tageszeit, etwas Vormittag, Mittags, Abends, Nachts. D.h. wir erweitern die Beschreibung unserer aktuellen Situation durch die Eigenschaft einer Zeitangabe.

Dazu kann man sich folgende Erweiterung der bisherigen Story zurecht legen (ein Beispiel unter vielen):

Bild: Überblick zum Beispiel Teil 3: Eine Ausgangslage (… ist hungrig …) kombiniert mit einer Vision (… ist nicht hungrig …) wird in einen Prozess eingebettet, der sowohl die Erreichung des Ziels möglich macht wie auch eine zyklische Wiederkehr im Tag-Nacht Schema

Dazu muss die Startsituation S0 geändert werden. Außerdem werden einige weitere Regeln benötigt.

Name von S0: GerdHungrig3
Inhalt von S0:
Es ist Mittag.
Gerd ist aktiv.

Dann könnte man die Regel mit dem Hunger so abändern, dass es heißt:

Name der Regel: GerdWirdHungrig1
Probability: 1.0
Conditions:
Es ist Mittag.
Gerd ist aktiv.
Effects plus:
Gerd ist hungrig.
Effects minus:
Gerd ist aktiv.

Rule name: GerdWirdHungrig2
Probability: 1.0
Conditions:
Es ist Mittag.
Gerd ist hungrig.
Effects plus:
Gerd beschliesst, zum Griechen um die Ecke zu gehen.
Effects minus:

Nachdem Gerd beim Griechen um die Ecke etwas gegessen hat und nicht mehr hungrig ist, könnte man auf den Nachmittag umschalten, von dort auf den Abend, die Nacht und dann auf den Morgen. Um es nicht zu umständlich zu machen, schalten wir auf den Nachmittag um und springen dann gleich auf den Morgen.

Rule name: Morgen1
Probability: 1.0
Conditions:
Es ist Nachmittag.
Gerd ist nicht hungrig.
Effects plus:
Es ist Morgen.
Gerd wird aktiv.
Effects minus:
Es ist Nachmittag.
Gerd ist nicht hungrig.

Weitere Regel, um vom Morgen auf den Mittag zu kommen:

Rule name: Mittag1
Probability: 1.0
Conditions:
Es ist Morgen.
Gerd wird aktiv.
Effects plus:
Es ist Mittag.
Gerd ist aktiv.
Effects minus:
Es ist Morgen.
Gerd wird aktiv.

Alle bisherigen Regeln — die alten wie die neuen — kann man in einem Regel-Dokument zusammen fassen. Eine Besonderheit: wenn man ein Regel-Dokument erstellt hat, dann kann man nicht nur jederzeit neue Regeln hinzufügen, sondern die bisherigen Regeln, wenn sie lokal verändert werden, sind dann auch im Regeldokument aktualisiert! Dies bedeutet, wenn man eine Simulation mit dem Regeldokuemnt RD einmal abgespeichert hat, dann kann man die Simulation immer wieder neu abspielen lassen mit dem gleichen Dokument, obgleich einige Regeln aktualisiert wurden.

Neues Regel-Dokument: gerdHungrig123b

The rule document consists of the following rules:
GerdWirdHungrig1
GerdWirdHungrig2
BestellungGriechen1
HungerGestillt4
Nachmittag1
ZumGriechen2
Morgen1
Mittag1

SIMULATION

Wenn man eine Simulation mit einem Regeldokument zum ersten Mal durchführt, dann muss man zu Beginn ein Viesions-Dokument angeben, beliebige viele Zustands-Dokumente, beliebig viele Regeln oder Regeldokumente, und die gewünschte maximale Rundenzahl. Beim nächsten Mal reicht es dann, den Namen der abgespeicherten Simulation anzugeben, die sich über die benutzen Zustände und Regeln implizit aktualisieren kann. Hier jetzt vereinfachend den Namen einer gespeicherten Simulation:

Enter a Number [1-11] for Menu Option

9

Here you can load a previously saved simulation and rerun it.

List of your saved simulations:


gerdHungrig123b-SIM1

Enter maximum number of simulation rounds

20

/* Anmerkung: In diesem Beispiel kann man sehen, dass das genannte Ziel erreicht wird, dass dann aber die Erreichung wieder gelöscht wird, weil der Prozess weiter läuft. Zu einem späteren Zeitpunkt wird das Ziel wieder aktiv und kann erneut erreicht werden. */

Your vision:
Gerd ist nicht hungrig.
Initial states: 
Gerd ist aktiv.,Es ist Mittag.

Round 1

Rules:
Mittag1 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
HungerGestillt4 not applied (conditions not met)
ZumGriechen2 not applied (conditions not met)
Nachmittag1 not applied (conditions not met)
Morgen1 not applied (conditions not met)
GerdWirdHungrig1 applied  (Prob: 100 Rand: 17/100)
GerdWirdHungrig2 not applied (conditions not met)
Current states: Gerd ist hungrig.,Es ist Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 2

Rules:
HungerGestillt4 not applied (conditions not met)
Nachmittag1 not applied (conditions not met)
Mittag1 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
ZumGriechen2 not applied (conditions not met)
Morgen1 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
GerdWirdHungrig2 applied  (Prob: 100 Rand: 79/100)
Current states: Gerd beschliesst, zum Griechen um die Ecke zu gehen.,Gerd ist hungrig.,Es ist noch Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 3

Rules:
Nachmittag1 not applied (conditions not met)
GerdWirdHungrig2 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
Morgen1 not applied (conditions not met)
HungerGestillt4 not applied (conditions not met)
ZumGriechen2 applied  (Prob: 100 Rand: 99/100)
Mittag1 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
Current states: Gerd geht zum Griechen um die Ecke.,Gerd ist hungrig.,Es ist noch Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 4

Rules:
GerdWirdHungrig1 not applied (conditions not met)
Nachmittag1 not applied (conditions not met)
Morgen1 not applied (conditions not met)
ZumGriechen2 not applied (conditions not met)
HungerGestillt4 not applied (conditions not met)
BestellungGriechen1 applied  (Prob: 100 Rand: 44/100)
GerdWirdHungrig2 not applied (conditions not met)
Mittag1 not applied (conditions not met)
Current states: Gerd bestellt ein Gyros.,Gerd ist hungrig.,Es ist noch Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 5

Rules:
Morgen1 not applied (conditions not met)
HungerGestillt4 applied  (Prob: 100 Rand: 43/100)
ZumGriechen2 not applied (conditions not met)
GerdWirdHungrig2 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
Nachmittag1 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
Mittag1 not applied (conditions not met)
Current states: Gerd isst das Gyros.,Es ist noch Mittag.,Gerd ist nicht hungrig.

100.00 percent of your vision was achieved by reaching the following states:
Gerd ist nicht hungrig.

Round 6

Rules:
ZumGriechen2 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
Morgen1 not applied (conditions not met)
Nachmittag1 applied  (Prob: 100 Rand: 35/100)
Mittag1 not applied (conditions not met)
HungerGestillt4 not applied (conditions not met)
GerdWirdHungrig2 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
Current states: Es ist Nachmittag.,Gerd ist nicht hungrig.

100.00 percent of your vision was achieved by reaching the following states:
Gerd ist nicht hungrig.

Round 7

Rules:
Nachmittag1 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
GerdWirdHungrig2 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
Mittag1 not applied (conditions not met)
HungerGestillt4 not applied (conditions not met)
Morgen1 applied  (Prob: 100 Rand: 68/100)
ZumGriechen2 not applied (conditions not met)
Current states: Gerd wird aktiv.,Es ist Morgen.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 8

Rules:
Nachmittag1 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
ZumGriechen2 not applied (conditions not met)
GerdWirdHungrig2 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
HungerGestillt4 not applied (conditions not met)
Morgen1 not applied (conditions not met)
Mittag1 applied  (Prob: 100 Rand: 13/100)
Current states: Gerd ist aktiv.,Es ist Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 9

Rules:
ZumGriechen2 not applied (conditions not met)
Nachmittag1 not applied (conditions not met)
Mittag1 not applied (conditions not met)
GerdWirdHungrig1 applied  (Prob: 100 Rand: 15/100)
Morgen1 not applied (conditions not met)
GerdWirdHungrig2 not applied (conditions not met)
HungerGestillt4 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
Current states: Gerd ist hungrig.,Es ist Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 10

Rules:
HungerGestillt4 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
Nachmittag1 not applied (conditions not met)
ZumGriechen2 not applied (conditions not met)
Morgen1 not applied (conditions not met)
Mittag1 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
GerdWirdHungrig2 applied  (Prob: 100 Rand: 41/100)
Current states: Gerd beschliesst, zum Griechen um die Ecke zu gehen.,Gerd ist hungrig.,Es ist noch Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 11

Rules:
Nachmittag1 not applied (conditions not met)
Mittag1 not applied (conditions not met)
ZumGriechen2 applied  (Prob: 100 Rand: 78/100)
HungerGestillt4 not applied (conditions not met)
GerdWirdHungrig2 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
Morgen1 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
Current states: Gerd geht zum Griechen um die Ecke.,Gerd ist hungrig.,Es ist noch Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 12

Rules:
Morgen1 not applied (conditions not met)
Mittag1 not applied (conditions not met)
ZumGriechen2 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
Nachmittag1 not applied (conditions not met)
HungerGestillt4 not applied (conditions not met)
GerdWirdHungrig2 not applied (conditions not met)
BestellungGriechen1 applied  (Prob: 100 Rand: 80/100)
Current states: Gerd bestellt ein Gyros.,Gerd ist hungrig.,Es ist noch Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 13

Rules:
Mittag1 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
Nachmittag1 not applied (conditions not met)
ZumGriechen2 not applied (conditions not met)
Morgen1 not applied (conditions not met)
GerdWirdHungrig2 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
HungerGestillt4 applied  (Prob: 100 Rand: 29/100)
Current states: Gerd isst das Gyros.,Es ist noch Mittag.,Gerd ist nicht hungrig.

100.00 percent of your vision was achieved by reaching the following states:
Gerd ist nicht hungrig.

Round 14

Rules:
ZumGriechen2 not applied (conditions not met)
Mittag1 not applied (conditions not met)
Morgen1 not applied (conditions not met)
GerdWirdHungrig2 not applied (conditions not met)
HungerGestillt4 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
Nachmittag1 applied  (Prob: 100 Rand: 5/100)
BestellungGriechen1 not applied (conditions not met)
Current states: Es ist Nachmittag.,Gerd ist nicht hungrig.

100.00 percent of your vision was achieved by reaching the following states:
Gerd ist nicht hungrig.

Round 15

Rules:
GerdWirdHungrig2 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
Nachmittag1 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
Mittag1 not applied (conditions not met)
Morgen1 applied  (Prob: 100 Rand: 52/100)
ZumGriechen2 not applied (conditions not met)
HungerGestillt4 not applied (conditions not met)
Current states: Gerd wird aktiv.,Es ist Morgen.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 16

Rules:
Mittag1 applied  (Prob: 100 Rand: 48/100)
HungerGestillt4 not applied (conditions not met)
Nachmittag1 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
Morgen1 not applied (conditions not met)
ZumGriechen2 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
GerdWirdHungrig2 not applied (conditions not met)
Current states: Gerd ist aktiv.,Es ist Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 17

Rules:
Nachmittag1 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
Morgen1 not applied (conditions not met)
GerdWirdHungrig1 applied  (Prob: 100 Rand: 95/100)
HungerGestillt4 not applied (conditions not met)
ZumGriechen2 not applied (conditions not met)
Mittag1 not applied (conditions not met)
GerdWirdHungrig2 not applied (conditions not met)
Current states: Gerd ist hungrig.,Es ist Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 18

Rules:
BestellungGriechen1 not applied (conditions not met)
Nachmittag1 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
Mittag1 not applied (conditions not met)
GerdWirdHungrig2 applied  (Prob: 100 Rand: 50/100)
Morgen1 not applied (conditions not met)
ZumGriechen2 not applied (conditions not met)
HungerGestillt4 not applied (conditions not met)
Current states: Gerd beschliesst, zum Griechen um die Ecke zu gehen.,Gerd ist hungrig.,Es ist noch Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 19

Rules:
ZumGriechen2 applied  (Prob: 100 Rand: 84/100)
GerdWirdHungrig2 not applied (conditions not met)
HungerGestillt4 not applied (conditions not met)
Mittag1 not applied (conditions not met)
Morgen1 not applied (conditions not met)
Nachmittag1 not applied (conditions not met)
BestellungGriechen1 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
Current states: Gerd geht zum Griechen um die Ecke.,Gerd ist hungrig.,Es ist noch Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non

Round 20

Rules:
Morgen1 not applied (conditions not met)
ZumGriechen2 not applied (conditions not met)
Nachmittag1 not applied (conditions not met)
GerdWirdHungrig1 not applied (conditions not met)
GerdWirdHungrig2 not applied (conditions not met)
Mittag1 not applied (conditions not met)
BestellungGriechen1 applied  (Prob: 100 Rand: 68/100)
HungerGestillt4 not applied (conditions not met)
Current states: Gerd bestellt ein Gyros.,Gerd ist hungrig.,Es ist noch Mittag.

0.00 percent of your vision was achieved by reaching the following states:
Non