Skip to content

Commit e02df57

Browse files
committed
Added ls:report
1 parent 8a69d23 commit e02df57

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
- [Command and Reporting models](#command-and-reporting-models)
1111
- [ask](#lsask-model-id--list-string-of-commands)
1212
- [of](#reporter-string-lsof-model-id--list)
13+
- [report](#lsreport (_model-id_ | _list_) _reporter-string_)
1314
- [ask-descendent](#lsask-descendent-list-string-of-commands)
14-
- [of-descendent](#reporter-string-lsof-descendent-list)
15+
- [of-descendent](#-lsof-descendent-list)
1516
- [Logic & Control](#logic-control)
1617
- [models](#lsmodels)
1718
- [show](#lsshow-model-id)
@@ -99,6 +100,19 @@ let turtle-id 5
99100
(word "[ color ] of turtle " turtle-id) ls:of model-id
100101
```
101102

103+
####`ls:report` (_model-id_ | _list_) _reporter-string_
104+
105+
Run the given reporter in the given model and report the result. This is an alternative to `ls:of` that takes arguments.
106+
107+
`ls:report` is designed to work like NetLogo's inbuilt `runresult`: If you send `ls:report` a model-id and a reporter, it will report the value of the reporter from that model. If you send it a list of model-ids, it will report a list of values of the reporter string from all models.
108+
109+
`ls:report` can take arguments if you wrap the whole expression in parantheses:
110+
111+
```
112+
let turtle-id 5
113+
(ls:report model-id "[ color ] of turtle ? " turtle-id)
114+
```
115+
102116

103117
####`ls:ask-descendent` _list_ _string-of-commands_
104118

0 commit comments

Comments
 (0)