| … | … | @@ -5,9 +5,64 @@ |
| 5 | 5 | ; |
| 6 | 6 | ; SEIR == "susceptible", "exposed", "infected", and "recovered". |
| 7 | 7 | ; |
| 8 | | ; Model with a state-transition machine. The state will be kept |
| 9 | | ; in a specific value. |
| 8 | ; This is a demo, only! It is demonstrating several different AtomSpace |
| 9 | ; programming techniques, one of which is the brand-new (version 0.1) |
| 10 | ; random network generator. Another is Value Flows: the use of Values |
| 11 | ; for holding mutable state, and flowing that state through a network. |
| 12 | ; It is assumed that the reader is already familiar with the basics of |
| 13 | ; the OpenCog AtomSpace! This demo *could* be altered, modified and |
| 14 | ; extended to do actual scientific research; see "making this useful", |
| 15 | ; below. |
| 16 | ; |
| 17 | ; This demo generates a random "social network", consisting of two types |
| 18 | ; of relationships: "friends" and "strangers". It adopts a simple SEIR |
| 19 | ; model of disease transmission and progression along this network. |
| 20 | ; The model itself is a (simple) hand-coded state-transition machine. |
| 21 | ; |
| 22 | ; Making this Useful |
| 23 | ; ------------------ |
| 24 | ; There's no whizzy visualization of the disease progression, or the |
| 25 | ; resulting stats. You can visualize snapshots of the network with |
| 26 | ; CytoScape or Gephi, but it won't be animated as the disease spreads. |
| 27 | ; |
| 28 | ; There's no statistical analysis performed, and no graphs or curves are |
| 29 | ; drawn. The demo shows how to generate the raw data, not how to analyze |
| 30 | ; raw data. |
| 31 | ; |
| 32 | ; Altering the disease progression model is not particularly easy. It is |
| 33 | ; written in Atomese, which is rather verbose, and programming in |
| 34 | ; Atomese is, in many ways, like programming in assembly code. This is |
| 35 | ; perhaps the most important thing to understand about this demo. |
| 36 | ; Atomese is a graphical programming language, and it was designed for |
| 37 | ; automation. This means that the graphs, and the Atomese code, is easy |
| 38 | ; to manipulate with other algorithms. It's designed for other machines, |
| 39 | ; not for humans :-/ |
| 40 | ; |
| 41 | ; For example, a graphical editor - a system that can draw and edit |
| 42 | ; graphs (such as CytoScape or Gephi, but also others) can be attached |
| 43 | ; to Atomese, so that a hand-drawn graphical model of disease progression |
| 44 | ; can be automatically converted into functional Atomese, and set |
| 45 | ; running. |
| 46 | ; |
| 47 | ; Another possibility is that of a disease-progression explorer: a |
| 48 | ; system that automatically creates a variety of different models, |
| 49 | ; and then explores how well each model works. Atomese was designed |
| 50 | ; for, is highly suited for such automation tasks. |
| 51 | ; |
| 52 | ; Thus, in reading the below, keep in mind that there is nothing special |
| 53 | ; about the SEIR model; its a stand-in for what could be a generic, |
| 54 | ; arbitrary state transition machine. Such machines can be hand-coded, |
| 55 | ; of course, but the interesting application is when they are generated |
| 56 | ; from other sources. |
| 57 | ; |
| 58 | ; Last but not least: keep in mind that the network generator is |
| 59 | ; currently at version 0.1, and is not yet as versatile, flexible and |
| 60 | ; powerful as it could be. The parameter settings below generate |
| 61 | ; networks that are long and thin. One such network can be seen in |
| 62 | ; the included image. |
| 63 | ; --------------------------------------------------------------------- |
| 10 | 64 | |
| 65 | ; Import needed modules |
| 11 | 66 | (use-modules (srfi srfi-1)) |
| 12 | 67 | (use-modules (opencog) (opencog exec)) |
| 13 | 68 | (use-modules (opencog generate)) |