| … | … | @@ -5,7 +5,7 @@ |
| 5 | 5 | ; |
| 6 | 6 | ; SEIR == "susceptible", "exposed", "infected", and "recovered". |
| 7 | 7 | ; |
| 8 | | ; This is a demo, only! It is demonstrating several different AtomSpace |
| 8 | ; This is a demo, only! It demonstrates several different AtomSpace |
| 9 | 9 | ; programming techniques, one of which is the brand-new (version 0.1) |
| 10 | 10 | ; random network generator. Another is Value Flows: the use of Values |
| 11 | 11 | ; for holding mutable state, and flowing that state through a network. |
| … | … | @@ -13,7 +13,7 @@ |
| 13 | 13 | ; the OpenCog AtomSpace! This demo *could* be enhanced to do actual |
| 14 | 14 | ; scientific exploration; see "making this useful", below. |
| 15 | 15 | ; |
| 16 | | ; This demo generates a random "social network", consisting of two types |
| 16 | ; The demo generates a random "social network", consisting of two types |
| 17 | 17 | ; of relationships: "friends" and "strangers". It adopts a simple SEIR |
| 18 | 18 | ; model of disease transmission and progression along this network. |
| 19 | 19 | ; The model itself is a (simple) hand-coded state-transition machine. |
| … | … | @@ -22,9 +22,12 @@ |
| 22 | 22 | ; |
| 23 | 23 | ; https://blog.opencog.org/2020/04/22/covid-19-modelling-and-random-social-networks/ |
| 24 | 24 | ; |
| 25 | | ; Reading the blog post might be easier than diving head-first into the |
| 26 | | ; code below. If you're lazy and just want to run the demo, then just |
| 27 | | ; start the guile shell, load this file, and ... the demo will run. |
| 25 | ; The blog post touches on the high-lites of the demo, avoiding all of |
| 26 | ; the grunge needed to make the code actually run. Thus, its easier to |
| 27 | ; read than the below. |
| 28 | ; |
| 29 | ; If you're lazy and just want to run the demo, then just start the |
| 30 | ; guile shell, load this file, and ... the demo will run. |
| 28 | 31 | ; |
| 29 | 32 | ; Making this Useful |
| 30 | 33 | ; ------------------ |
| … | … | @@ -36,16 +39,31 @@ |
| 36 | 39 | ; |
| 37 | 40 | ; There's no statistical analysis performed, and no graphs or curves are |
| 38 | 41 | ; drawn. The demo shows how to generate the raw data, not how to analyze |
| 39 | | ; raw data. |
| 42 | ; raw data. There are plenty of tools designed for statistical analysis. |
| 43 | ; Use those. |
| 44 | ; |
| 45 | ; A few notes about scheme, python and Atomese. This demo would appear |
| 46 | ; to be written ins scheme. It could have just as eassily been written |
| 47 | ; in python, without changing it's basic form (the AtomSpace has python |
| 48 | ; bindings.) It may seem hard to beleive, but the choice of language |
| 49 | ; doesn't really much matter. That's because all of the hard work is |
| 50 | ; done in Atomese. |
| 40 | 51 | ; |
| 41 | | ; Altering the disease progression model is not particularly easy. It is |
| 42 | | ; written in Atomese, which is rather verbose, and programming in |
| 43 | | ; Atomese is, in many ways, like programming in assembly code. This is |
| 44 | | ; perhaps the most important thing to understand about this demo. |
| 45 | 52 | ; Atomese is a graphical programming language, and it was designed for |
| 46 | | ; automation. This means that the graphs, and the Atomese code, is meant |
| 47 | | ; to be easy for other algorithms to manipulate. It's designed for other |
| 48 | | ; machines, not for humans :-! |
| 53 | ; automation. Atomese expressions are graphs; they live as graphs in the |
| 54 | ; AtomSpace graph database. Atomese encodes a type of "Abstract Syntax |
| 55 | ; Tree" (see https://en.wikipedia.org/wiki/Abstract_syntax_tree) and |
| 56 | ; such a representation is useful for all of the reasons that the |
| 57 | ; Wikipedia article says they are. But it also means that "coding" in |
| 58 | ; Atomese can sometimes feel unusual. Like: "Why can't I just code in |
| 59 | ; python? It would be so much easier!" -- Well, but that misses the |
| 60 | ; point. And the point is, again: Atomese was designed for automation. |
| 61 | ; |
| 62 | ; What this really means that the graphs are meant to be easy for other |
| 63 | ; algorithms to manipulate. It's designed for ease-of-use by machines, |
| 64 | ; not for humans! The style is more barren, unadorned, without |
| 65 | ; short-cuts. Its a bit verbose at times. That's OK, machines don't mind |
| 66 | ; verbosity and tedium. |
| 49 | 67 | ; |
| 50 | 68 | ; Consider, for example, a graphical editor - something where you can |
| 51 | 69 | ; drag-n-drop, hand-draw interacting bubble diagrams. Something easy |
| … | … | @@ -55,15 +73,21 @@ |
| 55 | 73 | ; it becomes easy -- really easy -- to convert such diagrams into |
| 56 | 74 | ; executable code. That's what Atomese is designed to do. |
| 57 | 75 | ; |
| 58 | | ; Another possibility is that of an automatic model explorer: a system |
| 59 | | ; that automatically creates a variety of different models, and then |
| 60 | | ; explores how well each model works. The automatic generator could, |
| 61 | | ; for example, mutate the best models and see if even better-fitting |
| 62 | | ; models can be obtained, searching for a best-fit. The goal of Atomese |
| 63 | | ; is that it becomes very easy for such models to be generated and run. |
| 64 | | ; The verboseness of Atomese is no longer a problem; the simple |
| 65 | | ; programming language it implements is easy for other tools to |
| 66 | | ; manipulate and control. That's what it's good for. |
| 76 | ; In this demo, the disease progression model is written in Atomese. |
| 77 | ; This is the model that a graphical GUI WYSIWYG whizz-bang system |
| 78 | ; would generate. |
| 79 | ; |
| 80 | ; Atomese enables other, more abstract approaches. Consider an automatic |
| 81 | ; model explorer: a system that automatically creates a variety of |
| 82 | ; different disease progression models, and then explores how each |
| 83 | ; model works. The model generator might try to fit an existing dataset. |
| 84 | ; Alternately, it could mutate models so as to obtain certain |
| 85 | ; characteristics. This moves beyond just adjusting some parameters |
| 86 | ; in some hand-created, hypothesized model. This is not just some |
| 87 | ; monte-carlo search or machine-learning hill-climbing for paramter |
| 88 | ; tuning. This is a whole-sale creation of previously non-existant |
| 89 | ; code. Atomese allows software to read, understand, mutate, modify |
| 90 | ; and write programs. |
| 67 | 91 | ; |
| 68 | 92 | ; Thus, in reading the below, keep in mind that there is nothing special |
| 69 | 93 | ; about the SEIR model; its a stand-in for what could be a generic, |