Skip to content

Commit dee5d6e

Browse files
committed
Updated file extensions in docs and errors
1 parent 24dc301 commit dee5d6e

4 files changed

Lines changed: 30 additions & 30 deletions

File tree

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ Asking and reporting in LevelSpace is conceptually pretty straight forward: You
1111

1212
In general, the LevelSpace syntax has been designed to align with existing NetLogo primitives whenever possible.
1313

14-
### Headless and Interactive Models
14+
### Headless and Interactive Models
1515

16-
LevelSpace has two different child model types; headless models and interactive models. They each have their strengths and weaknesses:
16+
LevelSpace has two different child model types; headless models and interactive models. They each have their strengths and weaknesses:
1717

18-
Interactive models
18+
Interactive models
1919
* are full-fledged models that give full access to their interface and widgets,
2020
* run a bit slower, and use more memory
2121
* are visible by default
2222

2323
Headless Models
24-
* only give you access to their view and command center
25-
* are faster and use less memory than interactive models.
24+
* only give you access to their view and command center
25+
* are faster and use less memory than interactive models.
2626
* are hidden by default
2727

2828
Typically you will want to use headless models when you are running a large number of models, or if you simply want to run them faster. Interactive models are good if you run a small amount of models, if you are writing a LevelSpace model and need to be able to debug, or if you need access to widgets during runtime.
@@ -45,7 +45,7 @@ A simple thing we can do is to open up some models, run them concurrently, and c
4545
to setup
4646
ls:reset
4747
ca
48-
ls:create-models 30 "Wolf Sheep Predation.nlogo"
48+
ls:create-models 30 "Wolf Sheep Predation.nlogox"
4949
ls:ask ls:models [ set grass? true setup ]
5050
reset-ticks
5151
end
@@ -62,7 +62,7 @@ end
6262

6363
This use case is based on the Model Interactions Example-model from the NetLogo Models Library.
6464

65-
Let's imagine that we have two models: a Wolf Sheep Predation-model called `WSP`, and a Climate Change model called `CC`. Now let's imagine that we want the regrowth time in the wSP model to depend on the temperature in the CC model. Using LevelSpace's primitives, we could do something like this:
65+
Let's imagine that we have two models: a Wolf Sheep Predation-model called `WSP`, and a Climate Change model called `CC`. Now let's imagine that we want the regrowth time in the wSP model to depend on the temperature in the CC model. Using LevelSpace's primitives, we could do something like this:
6666

6767
```
6868
; save new regrowth time in a temporary LevelSpace let-variable
@@ -75,7 +75,7 @@ Let's imagine that we have two models: a Wolf Sheep Predation-model called `WSP`
7575
7676
; finally ask both models to go
7777
ls:ask ls:models [ go ]
78-
```
78+
```
7979

8080
### A general Usecase: Tidying up "Dead" Child Models
8181

@@ -87,7 +87,7 @@ to-report remove-dead-models [list-of-models]
8787
end
8888
```
8989

90-
We then reassign each list of models with this, e.g.
90+
We then reassign each list of models with this, e.g.
9191

9292
```
9393
@@ -141,13 +141,13 @@ ls:create-models *number* *path*
141141
```
142142

143143

144-
Create the specified number of instances of the given .nlogo model. The path can be absolute, or relative to the main model. Compared with `ls:create-interactive-models`, this primitive creates lightweight models that are hidden by default. You should use this primitive if you plan on having many instances of the given model. The models may be shown using `ls:show`; when visible, they will have a view and command center, but no other widgets, e.g. plots or monitors.
144+
Create the specified number of instances of the given model. The path can be absolute, or relative to the main model. Compared with `ls:create-interactive-models`, this primitive creates lightweight models that are hidden by default. You should use this primitive if you plan on having many instances of the given model. The models may be shown using `ls:show`; when visible, they will have a view and command center, but no other widgets, e.g. plots or monitors.
145145

146146
If given a command, LevelSpace will call the command after loading each instance of the model with the `model-id` as the argument. This allows you to easily store model ids in a variable or list when loading models, or do other initialization. For example, to store a model id in a variable, you can do:
147147

148148
```NetLogo
149149
let model-id 0
150-
(ls:create-models "My-Model.nlogo" [ [id] -> set model-id id ])
150+
(ls:create-models "My-Model.nlogox" [ [id] -> set model-id id ])
151151
```
152152

153153
Child model RNGs are seeded from the parent models RNG when they are created.
@@ -164,7 +164,7 @@ ls:create-interactive-models *number* *path*
164164
```
165165

166166

167-
Like `ls:create-models`, creates the specified number of instances of the given .nlogo model. Unlike `ls:create-models`, `ls:create-interactive-models` creates models that are visible by default, and have all widgets. You should use this primitive if you plan on having only a handful of instances of the given model, and would like to be able to interact with the instances through their interfaces during runtime.
167+
Like `ls:create-models`, creates the specified number of instances of the given model. Unlike `ls:create-models`, `ls:create-interactive-models` creates models that are visible by default, and have all widgets. You should use this primitive if you plan on having only a handful of instances of the given model, and would like to be able to interact with the instances through their interfaces during runtime.
168168

169169
Child model RNGs are seeded from the parent models RNG when they are created.
170170
Thus, if you seed the parent's model RNG before child model before child models are created, the simulation as a whole will be reproducible.
@@ -434,7 +434,7 @@ ls:path-of *model-or-list-of-models*
434434
```
435435

436436

437-
Report the full path, including the .nlogo file name, of the model. If a list of models is given, a list of paths is reported.
437+
Report the full path, including the file name of the model. If a list of models is given, a list of paths is reported.
438438

439439

440440

@@ -445,7 +445,7 @@ ls:name-of *model-or-list-of-models*
445445
```
446446

447447

448-
Reports the name of the .nlogo file of the model. This is the name of the window in which the model appears when visible. If a list of models is given, a list of names is reported.
448+
Reports the name of the model file. This is the name of the window in which the model appears when visible. If a list of models is given, a list of names is reported.
449449

450450

451451

USING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@ Asking and reporting in LevelSpace is conceptually pretty straight forward: You
66

77
In general, the LevelSpace syntax has been designed to align with existing NetLogo primitives whenever possible.
88

9-
### Headless and Interactive Models
9+
### Headless and Interactive Models
1010

11-
LevelSpace has two different child model types; headless models and interactive models. They each have their strengths and weaknesses:
11+
LevelSpace has two different child model types; headless models and interactive models. They each have their strengths and weaknesses:
1212

13-
Interactive models
13+
Interactive models
1414
* are full-fledged models that give full access to their interface and widgets,
1515
* run a bit slower, and use more memory
1616
* are visible by default
1717

1818
Headless Models
19-
* only give you access to their view and command center
20-
* are faster and use less memory than interactive models.
19+
* only give you access to their view and command center
20+
* are faster and use less memory than interactive models.
2121
* are hidden by default
2222

2323
Typically you will want to use headless models when you are running a large number of models, or if you simply want to run them faster. Interactive models are good if you run a small amount of models, if you are writing a LevelSpace model and need to be able to debug, or if you need access to widgets during runtime.
@@ -40,7 +40,7 @@ A simple thing we can do is to open up some models, run them concurrently, and c
4040
to setup
4141
ls:reset
4242
ca
43-
ls:create-models 30 "Wolf Sheep Predation.nlogo"
43+
ls:create-models 30 "Wolf Sheep Predation.nlogox"
4444
ls:ask ls:models [ set grass? true setup ]
4545
reset-ticks
4646
end
@@ -57,7 +57,7 @@ end
5757

5858
This use case is based on the Model Interactions Example-model from the NetLogo Models Library.
5959

60-
Let's imagine that we have two models: a Wolf Sheep Predation-model called `WSP`, and a Climate Change model called `CC`. Now let's imagine that we want the regrowth time in the wSP model to depend on the temperature in the CC model. Using LevelSpace's primitives, we could do something like this:
60+
Let's imagine that we have two models: a Wolf Sheep Predation-model called `WSP`, and a Climate Change model called `CC`. Now let's imagine that we want the regrowth time in the wSP model to depend on the temperature in the CC model. Using LevelSpace's primitives, we could do something like this:
6161

6262
```
6363
; save new regrowth time in a temporary LevelSpace let-variable
@@ -70,7 +70,7 @@ Let's imagine that we have two models: a Wolf Sheep Predation-model called `WSP`
7070
7171
; finally ask both models to go
7272
ls:ask ls:models [ go ]
73-
```
73+
```
7474

7575
### A general Usecase: Tidying up "Dead" Child Models
7676

@@ -82,7 +82,7 @@ to-report remove-dead-models [list-of-models]
8282
end
8383
```
8484

85-
We then reassign each list of models with this, e.g.
85+
We then reassign each list of models with this, e.g.
8686

8787
```
8888

documentation.conf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ primitives = [
5454
alternateArguments: [ { type: number }, { name: path, type: string }, { type: command } ],
5555
tags: [ "opening-closing" ],
5656
description: """
57-
Create the specified number of instances of the given .nlogo model. The path can be absolute, or relative to the main model. Compared with `ls:create-interactive-models`, this primitive creates lightweight models that are hidden by default. You should use this primitive if you plan on having many instances of the given model. The models may be shown using `ls:show`; when visible, they will have a view and command center, but no other widgets, e.g. plots or monitors.
57+
Create the specified number of instances of the given model. The path can be absolute, or relative to the main model. Compared with `ls:create-interactive-models`, this primitive creates lightweight models that are hidden by default. You should use this primitive if you plan on having many instances of the given model. The models may be shown using `ls:show`; when visible, they will have a view and command center, but no other widgets, e.g. plots or monitors.
5858

5959
If given a command, LevelSpace will call the command after loading each instance of the model with the `model-id` as the argument. This allows you to easily store model ids in a variable or list when loading models, or do other initialization. For example, to store a model id in a variable, you can do:
6060

6161
```NetLogo
6262
let model-id 0
63-
(ls:create-models "My-Model.nlogo" [ [id] -> set model-id id ])
63+
(ls:create-models "My-Model.nlogox" [ [id] -> set model-id id ])
6464
```
6565

6666
Child model RNGs are seeded from the parent models RNG when they are created.
@@ -75,7 +75,7 @@ Use the `ls:random-seed` primitive to seed the model system's RNGs after child m
7575
alternateArguments: [ { type: number}, { name: path, type: string }, { type: command } ],
7676
tags: [ "opening-closing" ],
7777
description: """
78-
Like `ls:create-models`, creates the specified number of instances of the given .nlogo model. Unlike `ls:create-models`, `ls:create-interactive-models` creates models that are visible by default, and have all widgets. You should use this primitive if you plan on having only a handful of instances of the given model, and would like to be able to interact with the instances through their interfaces during runtime.
78+
Like `ls:create-models`, creates the specified number of instances of the given model. Unlike `ls:create-models`, `ls:create-interactive-models` creates models that are visible by default, and have all widgets. You should use this primitive if you plan on having only a handful of instances of the given model, and would like to be able to interact with the instances through their interfaces during runtime.
7979

8080
Child model RNGs are seeded from the parent models RNG when they are created.
8181
Thus, if you seed the parent's model RNG before child model before child models are created, the simulation as a whole will be reproducible.
@@ -332,7 +332,7 @@ Hide all of the given models *and their descendents*. Hiding models is a good wa
332332
tags: [ "logic" ],
333333
arguments: [ {name: model-or-list-of-models, type: number/list} ],
334334
description: """
335-
Report the full path, including the .nlogo file name, of the model. If a list of models is given, a list of paths is reported.
335+
Report the full path, including the file name of the model. If a list of models is given, a list of paths is reported.
336336
"""
337337
},
338338

@@ -344,7 +344,7 @@ Report the full path, including the .nlogo file name, of the model. If a list of
344344
tags: [ "logic" ],
345345
arguments: [ {name: model-or-list-of-models, type: number/list}],
346346
description: """
347-
Reports the name of the .nlogo file of the model. This is the name of the window in which the model appears when visible. If a list of models is given, a list of names is reported.
347+
Reports the name of the model file. This is the name of the window in which the model appears when visible. If a list of models is given, a list of names is reported.
348348
"""
349349
},
350350

src/main/LevelSpaceMenu.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class LevelSpaceMenu(tabManager: TabManager, val backingModelManager: ModelManag
110110
throw new ExtensionException(filePath + " did not compile properly. There is probably something wrong " +
111111
"with its code. Exception said" + e.getMessage);
112112
case e: IOException =>
113-
throw new ExtensionException("There was no .nlogo file at the path: \"" + filePath + "\"")
113+
throw new ExtensionException("There was no model file at the path: \"" + filePath + "\"")
114114
}
115115

116116

@@ -152,7 +152,7 @@ class LevelSpaceMenu(tabManager: TabManager, val backingModelManager: ModelManag
152152
val userEntry = FileDialog.showFiles(App.app.frame, "Select a path for new Model...", SAVEFILE)
153153
// we basically need to write an empty NetLogo model in before we read...
154154
val fileName =
155-
if (userEntry.endsWith(".nlogo")) userEntry else userEntry + ".nlogo"
155+
if (userEntry.endsWith(".nlogo") || userEntry.endsWith(".nlogox")) userEntry else userEntry + ".nlogox"
156156
val path = Paths.get(fileName)
157157
if (Files.exists(path)) {
158158
val fileAlreadyExists = s"The file $fileName already exists. Please choose a different name"

0 commit comments

Comments
 (0)