|
| 1 | +# Simple Viral Marketing, live |
| 2 | + |
| 3 | +[](https://rtmandreyev.github.io/construct/examples/netlogo-viral-marketing/) |
| 4 | + |
| 5 | +**[Open the live model →](https://rtmandreyev.github.io/construct/examples/netlogo-viral-marketing/)** · or |
| 6 | +[the construct](https://rtmandreyev.github.io/construct/examples/netlogo-viral-marketing/construct.html) |
| 7 | +of one NetLogo run |
| 8 | + |
| 9 | +An example of what Construct can be used for beyond objects: NetLogo's **Simple Viral Marketing** |
| 10 | +agent-based model, rebuilt to run live in the browser and drawn as a construct. Five hundred people |
| 11 | +and one product: the floor is who knows whom, and height is when each person adopted. You can set |
| 12 | +up a network, run it tick by tick, scrub the timeline, trace who convinced whom, and run it 100 |
| 13 | +times to compare with NetLogo's own BehaviorSpace results. |
| 14 | + |
| 15 | +**Credit:** *Simple Viral Marketing* © 2012 Uri Wilensky, NetLogo Models Library (Wilensky, U. & |
| 16 | +Rand, W., *An Introduction to Agent-Based Modeling*, MIT Press, 2015), licensed under |
| 17 | +[CC BY-NC-SA 3.0](https://creativecommons.org/licenses/by-nc-sa/3.0/). |
| 18 | + |
| 19 | +**License:** unlike the rest of Construct (MIT), **this folder is under CC BY-NC-SA 3.0**, because |
| 20 | +everything in it derives from the model: the page, the port of the model, the NetLogo run and the |
| 21 | +construct. See [LICENSE](LICENSE). |
| 22 | + |
| 23 | +## How it was made |
| 24 | + |
| 25 | +1. **NetLogo.** One run of the model in NetLogo 7.0.4 (random network, 500 people, betweenness |
| 26 | + seeding, budget 3, random-seed 2026), run through BehaviorSpace and exported: each person's |
| 27 | + adoption tick, its cause (seed, advertising or a neighbour) and the network as NetLogo laid it |
| 28 | + out. The decision rule is the library model's, unchanged. The export is `netlogo-run.js`. |
| 29 | +2. **The construct.** That run, turned into exact polylines, was written into a Construct scene by |
| 30 | + DeepSeek V4.1 Flash, over check-and-repair and art-direction rounds (`scene.json`); Construct |
| 31 | + builds it into [construct.html](https://rtmandreyev.github.io/construct/examples/netlogo-viral-marketing/construct.html). |
| 32 | +3. **The live page.** The model rebuilt rule for rule in JavaScript (`svm-model.js`), by Claude |
| 33 | + Opus 5.5, so it runs in the browser, and a page (`index.html`) that draws it in Construct's |
| 34 | + Measured Light style, tick by tick. The port uses its own random-number generator, so a seed |
| 35 | + here is not a NetLogo seed; over 100 runs per budget its mean times to 50, 90, 95 and 99% |
| 36 | + adoption came within 0 to 9 ticks of NetLogo's BehaviorSpace means, and full adoption within its |
| 37 | + wide run-to-run spread. |
| 38 | + |
| 39 | +Unlike the other examples, the page is not a Construct page: it loads three.js 0.160.0 from |
| 40 | +cdn.jsdelivr.net and its fonts (Instrument Serif, IBM Plex Mono) from Google Fonts, so it needs an |
| 41 | +internet connection. It opens from any static host or straight from disk. URL options: |
| 42 | +`?source=netlogo` (replay the NetLogo run), `?t=<tick>`, `?orbit=0`. |
| 43 | + |
| 44 | +The "who convinced whom" line credits one adopted neighbour at random, a drawing choice: the |
| 45 | +model's rule uses the share of adopted neighbours, not one person. |
0 commit comments