From: Frank Duncan Date: Tue, 25 Jan 2022 17:18:50 +0000 (-0600) Subject: Update documentation after 0.1.1 release X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2F0.x;p=clnl Update documentation after 0.1.1 release --- diff --git a/bin/generatedocs.sh b/bin/generatedocs.sh index abb1250..24f7609 100755 --- a/bin/generatedocs.sh +++ b/bin/generatedocs.sh @@ -10,12 +10,14 @@ generatedoc() { --eval "(quit)" 2> /dev/null | sed -n '/^----$/,$p' | tail -n +2 } -generatedoc :clnl > wiki/DocsMain.md -generatedoc :clnl-nvm > wiki/DocsNvm.md -generatedoc :clnl-interface > wiki/DocsOtherPackages.md -generatedoc :clnl-lexer >> wiki/DocsOtherPackages.md -generatedoc :clnl-parser >> wiki/DocsOtherPackages.md -generatedoc :clnl-transpiler >> wiki/DocsOtherPackages.md -generatedoc :clnl-code-parser >> wiki/DocsOtherPackages.md -generatedoc :clnl-model >> wiki/DocsOtherPackages.md -generatedoc :clnl-random >> wiki/DocsOtherPackages.md +generatedoc :clnl > docs/DocsMain.md +generatedoc :clnl-nvm > docs/DocsNvm.md +generatedoc :clnl-interface > docs/DocsOtherPackages.md +generatedoc :clnl-lexer >> docs/DocsOtherPackages.md +generatedoc :clnl-parser >> docs/DocsOtherPackages.md +generatedoc :clnl-transpiler >> docs/DocsOtherPackages.md +generatedoc :clnl-code-parser >> docs/DocsOtherPackages.md +generatedoc :clnl-model >> docs/DocsOtherPackages.md +generatedoc :clnl-random >> docs/DocsOtherPackages.md +generatedoc :clnl-gltk >> docs/DocsGltk.md +generatedoc :strictmath >> docs/DocsStrictMath.md diff --git a/docs/CLNL-as-a-lisp-library.md b/docs/CLNL-as-a-lisp-library.md index d4d6dab..0bdbf34 100644 --- a/docs/CLNL-as-a-lisp-library.md +++ b/docs/CLNL-as-a-lisp-library.md @@ -106,7 +106,9 @@ The following is a hand edited modification of wolf sheep to remove unnecessary (when grass? (clnl-nvm:ask (clnl-nvm:patches) (lambda () - (setf (clnl-nvm:agent-value :pcolor) (clnl-nvm:one-of (list (clnl-nvm:lookup-color :green) (clnl-nvm:lookup-color :brown)))) + (setf + (clnl-nvm:agent-value :pcolor) + (clnl-nvm:one-of (list (clnl-nvm:lookup-color :green) (clnl-nvm:lookup-color :brown)))) (if (equalp (clnl-nvm:agent-value :pcolor) (clnl-nvm:lookup-color :green)) (setf (clnl-nvm:agent-value :countdown) grass-regrowth-time) (setf (clnl-nvm:agent-value :countdown) (clnl-nvm:random grass-regrowth-time)))))) @@ -128,7 +130,12 @@ The following is a hand edited modification of wolf sheep to remove unnecessary (setf (clnl-nvm:agent-value :energy) (clnl-nvm:random (* 2.0d0 wolf-gain-from-food))) (clnl-nvm:setxy (clnl-nvm:random-xcor) (clnl-nvm:random-ycor)))) (display-labels) - (setf grass (clnl-nvm:count (clnl-nvm:with (clnl-nvm:patches) (lambda () (equalp (clnl-nvm:agent-value :pcolor) (clnl-nvm:lookup-color :green)))))) + (setf + grass + (clnl-nvm:count + (clnl-nvm:with + (clnl-nvm:patches) + (lambda () (equalp (clnl-nvm:agent-value :pcolor) (clnl-nvm:lookup-color :green)))))) (clnl-nvm:reset-ticks) :undefined) @@ -149,7 +156,12 @@ The following is a hand edited modification of wolf sheep to remove unnecessary (death) (reproduce-wolves))) (when grass? (clnl-nvm:ask (clnl-nvm:patches) (lambda () (grow-grass)))) - (setf grass (clnl-nvm:count (clnl-nvm:with (clnl-nvm:patches) (lambda () (equalp (clnl-nvm:agent-value :pcolor) (clnl-nvm:lookup-color :green)))))) + (setf + grass + (clnl-nvm:count + (clnl-nvm:with + (clnl-nvm:patches) + (lambda () (equalp (clnl-nvm:agent-value :pcolor) (clnl-nvm:lookup-color :green)))))) (clnl-nvm:tick) (display-labels) :undefined)) diff --git a/docs/Changelog.md b/docs/Changelog.md new file mode 100644 index 0000000..06e3cad --- /dev/null +++ b/docs/Changelog.md @@ -0,0 +1,112 @@ +# Changelog + +## [0.1.1 - Interim Release](https://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/0.1.1) + +This release was after we moved from github to consxy, and so old releases were lost. + +* Release 0.1.1, remove windows/osx release targets[34a80fe](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/34a80fe) +* UI/Model Parse - Sliders - WIP[89cb348](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/89cb348) +* UI/Model Parse - Textboxes[0c3453d](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/0c3453d) +* UI/Model Parse - Switches[5f87a9f](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/5f87a9f) +* Forever Buttons - Handle stop correctly[6cb99e3](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/6cb99e3) +* UI - Forever Buttons[bd5ae84](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/bd5ae84) +* UI - View positioned correctly[bc0c656](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/bc0c656) +* UI - Buttons[31a8f42](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/31a8f42) +* Model Parse - Buttons[bb7b484](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/bb7b484) +* Parser/Transpiler - Add optional reporter logic[a1c5dfe](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/a1c5dfe) +* CLI Extension - Button press[5a40730](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/5a40730) +* CLI moved from curses to opengl[04d5397](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/04d5397) + +## [0.1 - Engine - Wolf Sheep works](https://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/v0.1.0) +* Parse models v1 - sections - [c49ca54](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c49ca54) +* Parse widgets v1 - view - [2d8a7c9](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/2d8a7c9) +* World size from view - [213ed30](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/213ed30) +* Add strictmath library - [34a7f8e](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/34a7f8e) +* Torus topography v1 - fd works - [75a9610](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/75a9610) +* Parse widgets v1 - slider - [81d51af](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/81d51af) +* Parse widgets v1 - switch - [72aabe5](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/72aabe5) +* Parse widgets v2 - globals - [b4f2bfd](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/b4f2bfd) +* Improve lexer - Be able to lex wolf sheep - [04bfaf3](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/04bfaf3) +* Improve parser - handle structure of netlogo programs - [2d02833](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/2d02833) +* Code - globals - [3abea70](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/3abea70) +* Improve parser - add wolfsheep prims, infix ability - [72d7364](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/72d7364) +* Improve parser - generate prims from globals - [18f00de](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/18f00de) +* Improve parser - generate prims from lets - [b81522f](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/b81522f) +* Improve parser - generate prims from procedures - [c9cf0d1](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c9cf0d1) +* Improve parser - generate some prims from breed statements - [fb6e383](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/fb6e383) +* Prims - Implement ```=``` - [76f94e0](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/76f94e0) +* Prims - Implement ```!=``` - [c694b81](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c694b81) +* Prims - Implement ```-, *, +, /``` - [ede7df2](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/ede7df2) +* Prims - Implement ```<, <=``` - [aac9bb3](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/aac9bb3) +* Prims - Implement ```any?``` - [daa3b99](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/daa3b99) +* Prims - Implement ```die``` - [b018550](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/b018550) +* Prims - Implement ```rt, lt``` - [2c338ef](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/2c338ef) +* Prims - Implement ```if, ifelse``` - [d546c89](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d546c89) +* Prims - Implement ```colors, nobody``` - [399b297](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/399b297) +* Add patches - [8b23537](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/8b23537) +* Prims - Implement ```let``` - [1e4bdde](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/1e4bdde) +* Prims - Implement ```reset-ticks, tick, ticks``` - [9413d37](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/9413d37) +* Prims - Implement agent variables, Implement ```of, who``` - [82888b4](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/82888b4) +* Prims - Implement ```patches, pcolor, set``` - [f00d5c7](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/f00d5c7) +* Prims - Implement ```one-of``` - [c11c429](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c11c429) +* Prims - Implement ```color, label, label-color, size``` - [ef8590a](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/ef8590a) +* Prims - Implement ```random, random-xcor, random-ycor, setxy``` - [0a00e05](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/0a00e05) +* Make agentsets annotated lists, Implement ```count``` - [3528ea7](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/3528ea7) +* Prims - Update ```ask, of``` to take agents - [1d54233](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/1d54233) +* Prims - Update ```one-of``` to take lists - [5a7fb5c](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/5a7fb5c) +* Prims - Optional arguments - [bc4ccb4](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/bc4ccb4) +* Prims - Implement ```with``` - [083d6c2](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/083d6c2) +* Prims - Implement ```not``` - [9d76751](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/9d76751) +* Prims - Implement ```hatch``` - [1dd12dd](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/1dd12dd) +* Prims - Implement ```set-default-shape``` - [9eef8ec](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/9eef8ec) +* Prims - Implement ```round``` - [008caa3](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/008caa3) +* Prims - Implement ```clear-all, ca``` - [7a82368](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/7a82368) +* Prims - Implement ```display``` as placeholder - [aa47422](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/aa47422) +* Prims - Implement ```stop``` - [393d2cd](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/393d2cd) +* Implement Precedence - [c75540c](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c75540c) +* Add export to common lisp form, forms - [762ab38](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/762ab38) +* Code - ```procedures``` - [d5b1d22](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d5b1d22) +* Code - ```turtles-own``` - [97c390f](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/97c390f) +* Code - ```patches-own``` - [31f7cb6](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/31f7cb6) +* Prims - Implement ```turtles-here``` - [c739aec](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c739aec) +* Code - ```breeds``` - [bc6386a](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/bc6386a) +* Code - procedures handle ```stop``` better - [f011c77](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/f011c77) +* Prims - ```die``` halts execution - [3ae0c35](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/3ae0c35) +* Wolf Sheep works in tests - [807df6b](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/807df6b) +* Extension loading - CLI Extension loaded by default - [cca1c12](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/cca1c12) +* CLI Extension - ```q``` - [057ed8d](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/057ed8d) +* Parser - Add ```:token``` argument type - [b257366](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/b257366) +* CLI Extension - Add ```load```, ```help``` - [92fae8c](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/92fae8c) +* Shapes - polygon, circle, rectangle - [268b16d](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/268b16d) +* Shapes - dynamic coloring for only parts of shapes - [db4e129](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/db4e129) +* Code reformat - Break up nvm files, package declaration based on dictionary grouping - [885270b](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/885270b) +* Code reformat - Macro for functions implement commands to return ```:undefined``` - [6fc4a17](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/6fc4a17) +* Model export as lisp - Wolf sheep - [687ec5d](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/687ec5d) +* Release 0.1.0 - Engine - Wolf sheep works - [a66006d](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/a66006d) + +## [0.0 - Initial release](https://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/v0.1.0) +* Initial Setup - [291ea16](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/291ea16) +* Add empty run - [f22f4e3](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/f22f4e3) +* Add run - [e5bf9eb](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/e5bf9eb) +* Add basic runcmd - [fb4cf7e](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/fb4cf7e) +* Add very simple first pass at lexer - [b398914](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/b398914) +* Add RNG - [6c59eec](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/6c59eec) +* Update runcmd to run comands from input - [a0f8850](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/a0f8850) +* Test Infrastructure - [1ae8c7a](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/1ae8c7a) +* CL Deps held locally in the repository - [122faaf](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/122faaf) +* Export uses RNG - [d0e9e5a](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d0e9e5a) +* Create Turtles, v1 - [a4cc3c4](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/a4cc3c4) +* Show, v1 - [c5613b8](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c5613b8) +* Add ask and command blocks, v1 - [4a9ed57](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/4a9ed57) +* Added random-float and reporter tests - [d4ab333](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d4ab333) +* Shufflerator now shuffles like the NL one does! - [d429346](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d429346) +* Rename to clnl, add some documentation - [c34fdd7](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c34fdd7) +* Opengl view, v1 - [9471c42](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/9471c42) +* Add Readme - [e905f9a](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/e905f9a) +* Add CL style - [ee78f42](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/ee78f42) +* Add documentation checker for exported symbols - [5c8699f](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/5c8699f) +* Add simple ncurses command center - [fe712aa](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/fe712aa) +* Get working on OSX - [e473722](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/e473722) +* Get working on Windows 8 - [d568495](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d568495) +* Create deployables - [dc93f45](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/dc93f45) +* 0.0.0 Release - [d348277](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d348277) diff --git a/docs/DocsGltk.md b/docs/DocsGltk.md new file mode 100644 index 0000000..721ae03 --- /dev/null +++ b/docs/DocsGltk.md @@ -0,0 +1,458 @@ +# Package CLNL-GLTK + +Main clnl-gltk package. + +Use widgets available in clnl-gltk to create NetLogo user interface widgets in pure opengl. This project doesn't have much usefulness outside of CLNL. + +## Contents + +* **variable [\*font\-height\*](#variable-font-height)** - The height of the font used by CLNL-GLTK. +* **variable [\*font\-width\*](#variable-font-width)** - The width of the font used by CLNL-GLTK. +* **variable [\*slider\-height\*](#variable-slider-height)** - The default slider height. +* **variable [\*switch\-height\*](#variable-switch-height)** - The default switch height. +* **function [button](#function-button)** - _button_ creates a button widget. +* **function [clear](#function-clear)** - Rests the inputbox _ib_ to empty. +* **function [font-print](#function-font-print)** - _font-print_ prints _str_ to the screen. +* **function [inputbox](#function-inputbox)** - _inputbox_ creates an inputbox widget. +* **function [key-pressed](#function-key-pressed)** - _key-pressed_ will do the appropriate thing in the case of a key being pressed. +* **function [mousedown](#function-mousedown)** - _mousedown_ is the general purpose mousedown entry point for all widgets. It is used to alert widgets that a mouse button has been pressed, and where. There's no information on which button has been pressed. +* **function [mousemove](#function-mousemove)** - _mousemove_ is the general purpose mousemove entry point for all widgets. It is used to alert widgets to movements of the mouse, regardless of button state. +* **function [mouseup](#function-mouseup)** - _mouseup_ is the general purpose mouseup entry point for all widgets. It is used to alert widgets to that a mouse button has been released, and where. There's no information on which button has been released, and it is up to the widget to decide if a click was triggered. +* **function [render](#function-render)** - _render_ is the entry point for rendering different items in the CLNL-GLTK package. +* **function [reposition](#function-reposition)** - _reposition_ is the general purpose resizing entry point for all widgets. +* **function [resize](#function-resize)** - _resize_ is the general purpose resizing entry point for all widgets. +* **function [setup](#function-setup)** - _setup_ sets up the clnl-gltk system, calling all the necessary underlying functions. +* **function [slider](#function-slider)** - _slider_ creates a button widget. +* **function [switch](#function-switch)** - _switch_ creates a switch widget. +* **function [textbox](#function-textbox)** - _textbox_ creates a textbox widget. +* **function [textbox-text](#function-textbox-text)** - _textbox-text_ allows for the retrieving and setting of the internal text of textbox _tb_. +* **function [toggle](#function-toggle)** - _toggle_ toggles an _item_. +* **function [value](#function-value)** - Returns the _text_ that currently resides in the inputbox _ib_. + +## Variable \*FONT\-HEIGHT\* + +#### Value Type: + +an integer + +#### Initial Value: + +14 + +#### Description: + +The height of the font used by CLNL-GLTK. + +This can be used to calculate appropriate sizes of things that may have fonts displayed in them. + +## Variable \*FONT\-WIDTH\* + +#### Value Type: + +an integer + +#### Initial Value: + +7. + +#### Description: + +The width of the font used by CLNL-GLTK. + +This can be used to calculate appropriate sizes of things that may have fonts displayed in them. + +## Variable \*SLIDER\-HEIGHT\* + +#### Value Type: + +an integer + +#### Initial Value: + +33 + +#### Description: + +The default slider height. + +## Variable \*SWITCH\-HEIGHT\* + +#### Value Type: + +an integer + +#### Initial Value: + +33 + +#### Description: + +The default switch height. + +## Function **BUTTON** + +#### Syntax: + +**button** _x_ _y_ _width_ _height_ _text_ _callback_ _&key_ _forever_ => _button_ + +#### Arguments and Values: + +_x_---x offset, in pixels +_y_---y offset, in pixels +_width_---width, in pixels +_height_---height, in pixels +_text_---string for the textual display +_callback_---a function +_forever_---a boolean, including whether this button is a forever button +_button_---a button that can later be rendered + +#### Description: + +_button_ creates a button widget. + +The widget will center the viewable TE_x_T inside itself, replacing the last three characters with an ellipses if the text is too large for the given dimensions. It will never clip a character. + +_button_ objects also work with mouse movement functions. When it identifies that a click has happened, _callback_ will be called. + +When _forever_ is non NIL, an extra icon is added to the button. + +## Function **CLEAR** + +#### Syntax: + +**clear** _ib_ => _result_ + +#### Arguments and Values: + +_ib_---an inputbox +_result_---undefined + +#### Description: + +Rests the inputbox _ib_ to empty. + +## Function **FONT-PRINT** + +#### Syntax: + +**font-print** _str_ => _result_ + +#### Arguments and Values: + +_str_---a string to be printed to screen +_result_---undefined + +#### Description: + +_font-print_ prints _str_ to the screen. + +It affirms no assumptions that are required for it to run, in the interest of speed. Those assumptions include that an opengl window has been opened, that all matrices are correct, and that SETUP-FONT has been run. + +#### Examples: + +```(font-print #P"Hello World" t)``` => ```nil``` + +## Function **INPUTBOX** + +#### Syntax: + +**inputbox** _x_ _y_ _width_ => _ib_ + +#### Arguments and Values: + +_x_---x offset, in pixels +_y_---y offset, in pixels +_width_---width, in characters +_ib_---an inputbox that can later be rendered + +#### Description: + +_inputbox_ creates an inputbox widget. + +The inputbox is a simple, single lined, box that can hold a mutating string. Use the various _inputbox_-* functions to add to it and modify it. As a string is added to it that is too large, it will scroll the characters automatically. + +The widget is defined in terms of characters, rather than pixels. In this way, it will never clip a portion of a character off. + +## Function **KEY-PRESSED** + +#### Syntax: + +**key-pressed** _ib_ _key_ => _result_ + +#### Arguments and Values: + +_ib_---An inputbox +_key_---Key pressed, an integer or a symbol +_result_---Undefined + +#### Description: + +_key-pressed_ will do the appropriate thing in the case of a key being pressed. + +When an integer, will insert the text into the appropriate location, if it's an ascii character less than 256. + +The other values acceptable are: + +:key-left moves the cursor one to the left :key-right moves the cursor one to the right + +## Function **MOUSEDOWN** + +#### Syntax: + +**mousedown** _item_ _x_ _y_ => _result_ + +#### Arguments and Values: + +_item_---item handling event +_x_---an integer +_y_---an integer +_result_---undefined + +#### Description: + +_mousedown_ is the general purpose mousedown entry point for all widgets. It is used to alert widgets that a mouse button has been pressed, and where. There's no information on which button has been pressed. + +_x_ and _y_ are absolute coordinates, and assumed to be opengl coordinates, not window coordinates (meaning they match the render and setup functions of widgets). + +A catchall method that does nothing is also defined so that mouse functions can loop over all available widgets and let them decide what they want to do. + +## Function **MOUSEMOVE** + +#### Syntax: + +**mousemove** _item_ _x_ _y_ => _result_ + +#### Arguments and Values: + +_item_---item handling event +_x_---an integer +_y_---an integer +_result_---undefined + +#### Description: + +_mousemove_ is the general purpose mousemove entry point for all widgets. It is used to alert widgets to movements of the mouse, regardless of button state. + +_x_ and _y_ are absolute coordinates, and assumed to be opengl coordinates, not window coordinates (meaning they match the render and setup functions of widgets). + +A catchall method that does nothing is also defined so that mouse functions can loop over all available widgets and let them decide what they want to do. + +## Function **MOUSEUP** + +#### Syntax: + +**mouseup** _item_ _x_ _y_ => _result_ + +#### Arguments and Values: + +_item_---item handling event +_x_---an integer +_y_---an integer +_result_---undefined + +#### Description: + +_mouseup_ is the general purpose mouseup entry point for all widgets. It is used to alert widgets to that a mouse button has been released, and where. There's no information on which button has been released, and it is up to the widget to decide if a click was triggered. + +_x_ and _y_ are absolute coordinates, and assumed to be opengl coordinates, not window coordinates (meaning they match the render and setup functions of widgets). + +A catchall method that does nothing is also defined so that mouse functions can loop over all available widgets and let them decide what they want to do. + +## Function **RENDER** + +#### Syntax: + +**render** _item_ => _result_ + +#### Arguments and Values: + +_item_---item to be rendered +_result_---undefined + +#### Description: + +_render_ is the entry point for rendering different items in the CLNL-GLTK package. + +_render_ will return the opengl world to the way it found it after finishing, usually via just popping the matrix. + +## Function **REPOSITION** + +#### Syntax: + +**reposition** _item_ _x_ _y_ => _result_ + +#### Arguments and Values: + +_item_---item to be rendered +_x_---an integer +_y_---an integer +_result_---undefined + +#### Description: + +_reposition_ is the general purpose resizing entry point for all widgets. + +_x_ and _y_ are contextual to the actual item being repositioned, and may be even be ignored. + +## Function **RESIZE** + +#### Syntax: + +**resize** _item_ _width_ _height_ => _result_ + +#### Arguments and Values: + +_item_---item to be rendered +_width_---an integer +_height_---an integer +_result_---undefined + +#### Description: + +_resize_ is the general purpose resizing entry point for all widgets. + +_width_ and _height_ are contextual to the actual item being resized, and may be even be ignored. + +## Function **SETUP** + +#### Syntax: + +**setup** => _result_ + +#### Arguments and Values: + +_result_---undefined + +#### Description: + +_setup_ sets up the clnl-gltk system, calling all the necessary underlying functions. + +Calling before the opengl system has been initialized properly may or may not work, so calling it after everything else has been initialized is recommended. + +## Function **SLIDER** + +#### Syntax: + +**slider** _x_ _y_ _width_ _text_ _callback_ _min_ _max_ _increment_ _value_ => _slider_ + +#### Arguments and Values: + +_x_---x offset, in pixels +_y_---y offset, in pixels +_width_---width, in pixels +_text_---string for the textual display +_callback_---a function +_min_---minimum value +_max_---maximum value +_increment_---increment when moving the slider +_value_---inital value +_slider_---a slider that can later be rendered + +#### Description: + +_slider_ creates a button widget. + +TODO: The rest of this description needs to be updated! + +## Function **SWITCH** + +#### Syntax: + +**switch** _x_ _y_ _width_ _text_ _callback_ _&optional_ _initial-state_ => _switch_ + +#### Arguments and Values: + +_x_---x offset, in pixels +_y_---y offset, in pixels +_width_---width, in pixels +_text_---string for the textual display +_callback_---a function +_initial-state_---a boolean, defaulting to nil +_switch_---a switch that can later be rendered + +#### Description: + +_switch_ creates a switch widget. + +The widget will center the viewable TE_x_T inside itself, replacing the last three characters with an ellipses if the text is too large for the given dimensions. It will never clip a character. + +_switch_ objects also work with mouse movement functions. When it identifies that a mousedown has happened, the state of the _switch_ will be changed, and _callback_ will be called with the new state. + +The _initial-state_ defines whether the switch starts on or off. + +## Function **TEXTBOX** + +#### Syntax: + +**textbox** _x_ _y_ _width_ _height_ _&key_ _text_ _border_ _word-wrap_ => _tb_ + +#### Arguments and Values: + +_x_---x offset, in pixels +_y_---y offset, in pixels +_width_---width, in characters +_height_---height, in characters +_text_---optional string for the textual display +_border_---boolean, whether we draw a border, defaults to t +_word-wrap_---boolean, whether we attempt to wrap the text +_tb_---a textbox that can later be rendered + +#### Description: + +_textbox_ creates a textbox widget. + +The widget is defined in terms of characters, rather than pixels. In this way, it will never clip a portion of a character off. It will also display whatever it can of its text, clipping off characters that are outside. + +Multiline strings are supported, and each one appears on a new line. + +When _border_ is NIL, no border is drawn and the text box floats, which can be useful for labels. + +When _word-wrap_ is non NIL, the text is attempted to wrap by the following rules. The wrapping is done at the line if possible, at a breaking character if possible, or just fits as many letters as it can befoer wrapping. It then only clips off on the bottom. The only breaking character currently is #Space. + +## Function **TEXTBOX-TEXT** + +#### Syntax: + +**textbox-text** _tb_ => _text_ + +#### Arguments and Values: + +_tb_---a textbox +_text_---string currently being displayed + +#### Description: + +_textbox-text_ allows for the retrieving and setting of the internal text of textbox _tb_. + +## Function **TOGGLE** + +#### Syntax: + +**toggle** _item_ _&optional_ _state_ => _new-state_ + +#### Arguments and Values: + +_item_---an item +_state_---a boolean, the state to set to +_new-state_---a boolean, the state after being set + +#### Description: + +_toggle_ toggles an _item_. + +Inverts the current toggle status of the _item_ if no _state_ passed in, otherwise sets to _state_. + +## Function **VALUE** + +#### Syntax: + +**value** _ib_ => _text_ + +#### Arguments and Values: + +_ib_---an inputbox +_text_---a string, the text currently in _ib_ + +#### Description: + +Returns the _text_ that currently resides in the inputbox _ib_. diff --git a/docs/DocsMain.md b/docs/DocsMain.md new file mode 100644 index 0000000..94e57ac --- /dev/null +++ b/docs/DocsMain.md @@ -0,0 +1,176 @@ +# Package CLNL + +Main CLNL package + +The entry point for general purpose clnl startup, as well as the place that ties all the parts together into a cohesive whole. + +## Contents + +* **variable [\*model\-package\*](#variable-model-package)** - _*model-package*_ is used for interning symbols as a NetLogo code gets compiled. +* **function [boot](#function-boot)** - _boot_ does exactly that, boots the clnl system in a clean state. The seed is set so that multiple runs will evaluate to the same. +* **function [model->multi-form-lisp](#function-model->multi-form-lisp)** - _model->multi-form-lisp_ takes a model and returns a multi form lisp program, that when executed, sets up the model. Procedures map to defuns, globals to defvars, etc. This can be output to load up quickly later. A function named by _boot-fn_ will be set for booting the program. +* **function [model->single-form-lisp](#function-model->single-form-lisp)** - _model->single-form-lisp_ takes a model and returns a lisp program as a single form, that when executed runs the model. The _seed_ passed in is used to start the clnl-random RNG. +* **function [nlogo->lisp](#function-nlogo->lisp)** - _nlogo->lisp_ takes a stream _str_ and returns a multi form lisp program, that when executed, sets up the model. See MODEL->MULTI-FORM-LISP for more information. +* **function [run](#function-run)** - _run_ starts up the CLNL system. +* **function [run-commands](#function-run-commands)** - _run-commands_ will take NetLogo commands, put them through the various stages need to turn them into Common Lisp code, and run it. +* **function [run-reporter](#function-run-reporter)** - _run-reporter_ will take a NetLogo _reporter_, put it through the various stages need to turn them into Common Lisp code, run it, and return the _result_. + +## Variable \*MODEL\-PACKAGE\* + +#### Value Type: + +a package + +#### Initial Value: + +The package named by :clnl-default-model-package + +#### Description: + +_*model-package*_ is used for interning symbols as a NetLogo code gets compiled. + +:clnl-default-model-package is used because it's set up to shadow common overlaps between the :cl package and netlogo programs, most notably GO. When you set this to a package of your choosing, be aware of those overlaps in the case that use :use :common-lisp + +Any local symbols are interned in this package, for use either by other code, or in order to have all symbols interned in the same placakge. This is also the package in which a model should be run, whether by clnl code or independently. + +## Function **BOOT** + +#### Syntax: + +**boot** _&optional_ _file_ _headless-mode_ => _result_ + +#### Arguments and Values: + +_file_---nlogo file with which to initialize state +_headless-mode_---a boolean, defaults to nil +_result_---undefined + +#### Description: + +_boot_ does exactly that, boots the clnl system in a clean state. The seed is set so that multiple runs will evaluate to the same. + +When _file_ is not provided, a default model is used. + +When _headless-mode_ is set to nil, the opengl interface is initialized. Otherwise, the model will run headlessly, with no view. + +## Function **MODEL->MULTI-FORM-LISP** + +#### Syntax: + +**model->multi-form-lisp** _model_ _boot-fn_ _&key_ _seed_ _initialize-interface_ _netlogo-callback-fn_ => _forms_ + +#### Arguments and Values: + +_model_---A valid model +_boot-fn_---A function name +_seed_---An integer, defaults to 15 +_initialize-interface_---A boolean +_netlogo-callback-fn_---a symbol +_forms_---A list of common lisp form + +#### Description: + +_model->multi-form-lisp_ takes a model and returns a multi form lisp program, that when executed, sets up the model. Procedures map to defuns, globals to defvars, etc. This can be output to load up quickly later. A function named by _boot-fn_ will be set for booting the program. + +The _seed_ passed in is used to start the clnl-random RNG. + +_initialize-interface_, when non nil, leads to initialization code for the opengl interface being included. + +_netlogo-callback-fn_ is a symbol that will be defined as a function to be called to execute code in the running netlogo instance. + +## Function **MODEL->SINGLE-FORM-LISP** + +#### Syntax: + +**model->single-form-lisp** _model_ _&key_ _seed_ _initialize-interface_ _netlogo-callback_ => _form_ + +#### Arguments and Values: + +_model_---A valid model +_seed_---An integer, defaults to 15 +_initialize-interface_---A boolean +_netlogo-callback_---A function of one argument, or a symbol +_form_---A common lisp form + +#### Description: + +_model->single-form-lisp_ takes a model and returns a lisp program as a single form, that when executed runs the model. The _seed_ passed in is used to start the clnl-random RNG. + +_initialize-interface_, when non nil, leads to initialization code for the opengl interface being included. + +_netlogo-callback_ is a function that when called with a single argument, a function that when called with netlogo code, will compile and run that code in the environment of the model. + +Of note, all globals defined either in the model code or via the widgets are declared special in order to remain in the lexical environment for EVAL. + +## Function **NLOGO->LISP** + +#### Syntax: + +**nlogo->lisp** _str_ _pkg-symb_ _boot-fn_ _&key_ _seed_ _initialize-interface_ _netlogo-callback-fn_ => _forms_ + +#### Arguments and Values: + +_str_---A stream holding an nlogo file +_pkg-symb_---A symbol for the generated package +_boot-fn_---A function name +_seed_---An integer, defaults to 15 +_initialize-interface_---A boolean +_netlogo-callback-fn_---a symbol +_forms_---A list of common lisp form + +#### Description: + +_nlogo->lisp_ takes a stream _str_ and returns a multi form lisp program, that when executed, sets up the model. See MODEL->MULTI-FORM-LISP for more information. + +_nlogo->lisp_ does extra work of setting up the package to be named by _pkg-symb_ in order to correctly shadow common lisp functions. + +It will also change the current package to the one created for the model named by _pkg-symb_. + +#### Examples: + +```(with-open-file (str "Wolf Sheep Predation.nlogo") (nlogo->lisp str :wolfsheep 'boot))``` => ```(forms)``` + +## Function **RUN** + +#### Syntax: + +**run** _&optional_ _file_ => _result_ + +#### Arguments and Values: + +_file_---nlogo file with which to initialize +_result_---undefined, the system terminates at the end of the loop + +#### Description: + +_run_ starts up the CLNL system. + +## Function **RUN-COMMANDS** + +#### Syntax: + +**run-commands** _cmds_ => _result_ + +#### Arguments and Values: + +_cmds_---A string that may have one more NetLogo commands +_result_---undefined + +#### Description: + +_run-commands_ will take NetLogo commands, put them through the various stages need to turn them into Common Lisp code, and run it. + +## Function **RUN-REPORTER** + +#### Syntax: + +**run-reporter** _reporter_ => _result_ + +#### Arguments and Values: + +_reporter_---A string that should have only one reporter +_result_---The value reported by the NVM + +#### Description: + +_run-reporter_ will take a NetLogo _reporter_, put it through the various stages need to turn them into Common Lisp code, run it, and return the _result_. diff --git a/docs/DocsNvm.md b/docs/DocsNvm.md new file mode 100644 index 0000000..9b78bb2 --- /dev/null +++ b/docs/DocsNvm.md @@ -0,0 +1,667 @@ +# Package CLNL-NVM + +CLNL NVM + +NetLogo Virtual Machine: the simulation engine. + +## Contents + +* **function [agent-value](#function-agent-value)** - _agent-value_ is the general agent variable access function. For many NetLogo reporters, the compilation results is _agent-value_. The list of valid values are any builtin variable in the NetLogo dictionary, as well as any *-own variable. +* **function [ask](#function-ask)** - _ask_ is equivalent to ask in NetLogo. +* **function [clear-all](#function-clear-all)** - Clears ticks, turtles, patches, globals (unimplemented). +* **function [count](#function-count)** - _count_ is equivalent to count in _n_etLogo. Returns _n_, the number of agents in _agentset_. +* **function [create-turtles](#function-create-turtles)** - Creates _n_ new turtles at the origin. +* **function [create-world](#function-create-world)** - Initializes the world in the NVM. +* **function [current-state](#function-current-state)** - Dumps out the state of the world. +* **function [die](#function-die)** - The turtle or link dies +* **function [display](#function-display)** - As of yet, this does nothing. A placeholder method for forced dipslay updates from the engine. +* **function [export-world](#function-export-world)** - Dumps out a csv matching NetLogo's export world. +* **function [forward](#function-forward)** - Moves the current turtle forward _n_ steps, one step at a time. +* **function [hatch](#function-hatch)** - The turtle in *self* creates _n_ new turtles. Each new turtle inherits of all its variables, including its location, from self. +* **function [lookup-color](#function-lookup-color)** - Returns the number used to represent colors in NetLogo. +* **function [of](#function-of)** - _of_ is equivalent to of in NetLogo. +* **function [one-of](#function-one-of)** - From an _agentset_, returns a _random-agent_. If the agentset is empty, returns :nobody. From a list, returns a _random-value_. If the list is empty, an error occurs. +* **function [patches](#function-patches)** - Reports the agentset consisting of all the patches. +* **function [random](#function-random)** - Returns a random number strictly closer to zero than _n_. +* **function [random-float](#function-random-float)** - Returns a random number strictly closer to zero than _n_. +* **function [random-xcor](#function-random-xcor)** - Returns a random floating point number in the allowable range of turtle coordinates along the x axis. +* **function [random-ycor](#function-random-ycor)** - Returns a random floating point number in the allowable range of turtle coordinates along the y axis. +* **function [reset-ticks](#function-reset-ticks)** - Resets the tick counter to zero, sets up all plots, then updates all plots. +* **function [set-default-shape](#function-set-default-shape)** - Specifies a default initial shape for a _breed_. When a turtle, or it changes breeds, its shape is set to the given shape. +* **function [setxy](#function-setxy)** - Sets the x-coordinate and y-coordinate for the turle. Equivalent to set xcor x set ycor y, except it happens in one step inside of two. +* **function [show](#function-show)** - A command that prints the given NetLogo value to the command center. +* **function [stop](#function-stop)** - Returns from the current stop block, which will halt the currently running thing, be that the program, current ask block, or procedure. Stop has odd semantics that are best gleaned from the actual NetLogo manual. +* **function [tick](#function-tick)** - Advances the tick counter by one and updates all plots. +* **function [ticks](#function-ticks)** - Reports the current value of the tick counter. The result is always a number and never negative. +* **function [turn-left](#function-turn-left)** - The turtle turns left by number degrees. (If number is negative, it turns right.) +* **function [turn-right](#function-turn-right)** - The turtle turns right by number degrees. (If number is negative, it turns left.) +* **function [turtles](#function-turtles)** - Reports the agentset consisting of all the turtles. +* **function [turtles-here](#function-turtles-here)** - Returns the agentset consisting of all the turtles sharing the patch with the agent in by *self* +* **function [with](#function-with)** - _with_ is equivalent to with in NetLogo. +* **function [with-stop-handler](#function-with-stop-handler)** - _with-stop-handler_ is a convenience macro to handle when programs issue a stop condition. When one does, a simple :stop is returned. + +## Function **AGENT-VALUE** + +#### Syntax: + +**agent-value** _var_ _&optional_ _agent_ => _result_ + +#### Arguments and Values: + +_var_---A variable name +_agent_---an agent, defaulting to *self* +_result_---the value of _var_ + +#### Description: + +_agent-value_ is the general agent variable access function. For many NetLogo reporters, the compilation results is _agent-value_. The list of valid values are any builtin variable in the NetLogo dictionary, as well as any *-own variable. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html for builtins + +## Function **ASK** + +#### Syntax: + +**ask** _agent-or-agentset_ _fn_ => _result_ + +```agent-or-agentset::= agent | agentset``` +```result::= :undefined``` + +#### Arguments and Values: + +_fn_---a function, run on each agent +_agent_---a NetLogo agent +_agentset_---a NetLogo agentset + +#### Description: + +_ask_ is equivalent to ask in NetLogo. + +The specified _agent_SET or _agent_ runs the given _fn_. In the case of an _agent_SET, the order in which the agents are run is random each time, and only agents that are in the set at the beginning of the call. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#ask + +## Function **CLEAR-ALL** + +#### Syntax: + +**clear-all** => _result_ + +```result::= :undefined``` + +#### Description: + +Clears ticks, turtles, patches, globals (unimplemented). + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#clear-all + +## Function **COUNT** + +#### Syntax: + +**count** _agentset_ => _n_ + +#### Arguments and Values: + +_agentset_---a _n_etLogo agentset +_n_---a number + +#### Description: + +_count_ is equivalent to count in _n_etLogo. Returns _n_, the number of agents in _agentset_. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#count + +## Function **CREATE-TURTLES** + +#### Syntax: + +**create-turtles** _n_ _&optional_ _breed_ _fn_ => _result_ + +```result::= :undefined``` + +#### Arguments and Values: + +_n_---an integer, the numbers of turtles to create +_breed_---a breed +_fn_---A function, applied to each turtle after creation + +#### Description: + +Creates _n_ new turtles at the origin. + +_n_ew turtles have random integer headings and the color is randomly selected from the 14 primary colors. If F_n_ is supplied, the new turtles immediately run it. If a _breed_ is supplied, that is the breed the new turtles are set to. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#create-turtles + +## Function **CREATE-WORLD** + +#### Syntax: + +**create-world** _&key_ _dims_ _globals_ _turtles-own-vars_ _patches-own-vars_ _breeds_ => _result_ + +```dims::= (:xmin xmin :xmax xmax :ymin ymin :ymax ymax)``` +```globals::= global*``` +```turtles-own-vars::= turtles-own-var*``` +```patches-own-vars::= patches-own-var*``` +```breeds::= breed*``` +```result::= :undefined``` +```global::= (global-name global-access-func)``` + +#### Arguments and Values: + +_xmin_---An integer representing the minimum patch coord in X +_xmax_---An integer representing the maximum patch coord in X +_ymin_---An integer representing the minimum patch coord in Y +_ymax_---An integer representing the maximum patch coord in Y +_turtles-own-var_---Symbol for the turtles own variable in the keyword package +_patches-own-var_---Symbol for the patches own variable in the keyword package +_breed_---A list of symbols representing the possible preeds +_global-name_---Symbol for the global in the keyword package +_global-access-func_---Function to get the value of the global + +#### Description: + +Initializes the world in the NVM. + +This should be called before using the engine in any real capacity. If called when an engine is already running, it may do somethign weird. + +## Function **CURRENT-STATE** + +#### Syntax: + +**current-state** => _world-state_ + +#### Arguments and Values: + +_world-state_---A list, the current state of the whole world + +#### Description: + +Dumps out the state of the world. + +This is useful for visualizations and also storing in a common lisp data structure for easy usage in a common lisp instance. It's preferable to use this when working with the nvm than the output done by export-world. + +Currently this only dumps out turtle and patch information. + +This is called _current-state_ because export-world is an actual primitive used by NetLogo. + +## Function **DIE** + +#### Syntax: + +**die** => _result_ + +```result::= :undefined``` + +#### Description: + +The turtle or link dies + +A dead agent ceases to exist. The effects of this include: - The agent will not execute any further code. - The agent will disappear from any agentsets it was in, reducing the size of those agentsets by one. - Any variable that was storing the agent will now instead have nobody in it. - If the dead agent was a turtle, every link connected to it also dies. - If the observer was watching or following the agent, the observer's perspective resets. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#die + +## Function **DISPLAY** + +#### Syntax: + +**display** => _result_ + +```result::= :undefined``` + +#### Description: + +As of yet, this does nothing. A placeholder method for forced dipslay updates from the engine. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#display + +## Function **EXPORT-WORLD** + +#### Syntax: + +**export-world** => _world-csv_ + +#### Arguments and Values: + +_world-csv_---A string, the csv of the world + +#### Description: + +Dumps out a csv matching NetLogo's export world. + +This is useful for serializing the current state of the engine in order to compare against NetLogo or to reimport later. Contains everything needed to boot up a NetLogo instance in the exact same state. + +## Function **FORWARD** + +#### Syntax: + +**forward** _n_ => _result_ + +```result::= :undefined``` + +#### Arguments and Values: + +_n_---a double, the amount the turtle moves forward + +#### Description: + +Moves the current turtle forward _n_ steps, one step at a time. + +This moves forward one at a time in order to make the view updates look good in the case of a purposefully slow running instance. If the number is negative, the turtle moves backward. + +If the current agent is not a turtle, it raises an error. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#forward + +## Function **HATCH** + +#### Syntax: + +**hatch** _n_ _&optional_ _fn_ => _result_ + +```result::= :undefined``` + +#### Arguments and Values: + +_n_---an integer, the numbers of turtles to hatch +_fn_---A function, applied to each turtle after creation + +#### Description: + +The turtle in *self* creates _n_ new turtles. Each new turtle inherits of all its variables, including its location, from self. + +If F_n_ is supplied, the new turtles immediately run it. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#hatch + +## Function **LOOKUP-COLOR** + +#### Syntax: + +**lookup-color** _color_ => _color-number_ + +#### Arguments and Values: + +_color_---a symbol representing a color +_color-number_---the NetLogo color integer + +#### Description: + +Returns the number used to represent colors in NetLogo. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#Constants + +## Function **OF** + +#### Syntax: + +**of** _fn_ _agent-or-agentset_ => _result_ + +```agent-or-agentset::= agent | agentset``` +```result::= result-list | result-value``` + +#### Arguments and Values: + +_fn_---a function, run on each agent +_agent_---a NetLogo agent +_agentset_---a NetLogo agentset +_result-list_---a list +_result-value_---a single value + +#### Description: + +_of_ is equivalent to of in NetLogo. + +The specified _agent_SET or _agent_ runs the given _fn_. In the case of an _agent_SET, the order in which the agents are run is random each time, and only agents that are in the set at the beginning of the call. + +_result_-LIST is returned when the input is an _agent_SET, but _result_-VALUE is returned when only passed an _agent_. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#of + +## Function **ONE-OF** + +#### Syntax: + +**one-of** _list-or-agentset_ => _result_ + +```list-or-agentset::= list | agentset``` +```result::= random-value | random-agent | :nobody``` + +#### Arguments and Values: + +_list_---A list +_agentset_---An agent set +_random-value_---a value in _list_ +_random-agent_---an agent if _agentset_ is non empty + +#### Description: + +From an _agentset_, returns a _random-agent_. If the agentset is empty, returns :nobody. From a list, returns a _random-value_. If the list is empty, an error occurs. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#one-of + +## Function **PATCHES** + +#### Syntax: + +**patches** => _all-patches_ + +#### Arguments and Values: + +_all-patches_---a NetLogo agentset, all patches + +#### Description: + +Reports the agentset consisting of all the patches. + +This agentset is special in that it represents the living patches each time it's used, so changes depending on the state of the engine. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#patches + +## Function **RANDOM** + +#### Syntax: + +**random** _n_ => _random-number_ + +#### Arguments and Values: + +_n_---an integer, the upper bound of the random +_random-number_---an integer, the random result + +#### Description: + +Returns a random number strictly closer to zero than _n_. + +If number is positive, returns a random integer greater than or equal to 0, but strictly less than number. + +If number is negative, returns a random integer less than or equal to 0, but strictly greater than number. + +If number is zero, the result is always 0. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#random + +## Function **RANDOM-FLOAT** + +#### Syntax: + +**random-float** _n_ => _random-number_ + +#### Arguments and Values: + +_n_---a double, the upper bound of the random float +_random-number_---a double, the random result + +#### Description: + +Returns a random number strictly closer to zero than _n_. + +If number is positive, returns a random floating point number greater than or equal to 0 but strictly less than number. + +If number is negative, returns a random floating point number less than or equal to 0, but strictly greater than number. + +If number is zero, the result is always 0. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#random-float + +## Function **RANDOM-XCOR** + +#### Syntax: + +**random-xcor** => _random-number_ + +#### Arguments and Values: + +_random-number_---a float, the random result + +#### Description: + +Returns a random floating point number in the allowable range of turtle coordinates along the x axis. + +These range from min-pxcor - 0.5 (inclusive) to max-pxcor + 0.5 (exclusive) + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#random-cor + +## Function **RANDOM-YCOR** + +#### Syntax: + +**random-ycor** => _random-number_ + +#### Arguments and Values: + +_random-number_---a float, the random result + +#### Description: + +Returns a random floating point number in the allowable range of turtle coordinates along the y axis. + +These range from min-pycor - 0.5 (inclusive) to max-pycor + 0.5 (exclusive) + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#random-cor + +## Function **RESET-TICKS** + +#### Syntax: + +**reset-ticks** => _result_ + +```result::= :undefined``` + +#### Description: + +Resets the tick counter to zero, sets up all plots, then updates all plots. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#reset-ticks + +## Function **SET-DEFAULT-SHAPE** + +#### Syntax: + +**set-default-shape** _breed_ _shape_ => _result_ + +```result::= :undefined``` + +#### Arguments and Values: + +_breed_---a valid breed +_shape_---a string + +#### Description: + +Specifies a default initial shape for a _breed_. When a turtle, or it changes breeds, its shape is set to the given shape. + +_set-default-shape_ doesn't affect existing agents, only agents you create afterwards. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#set-default-shape + +## Function **SETXY** + +#### Syntax: + +**setxy** _x_ _y_ => _result_ + +```result::= :undefined``` + +#### Arguments and Values: + +_x_---a double +_y_---a double + +#### Description: + +Sets the x-coordinate and y-coordinate for the turle. Equivalent to set xcor x set ycor y, except it happens in one step inside of two. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#setxy + +## Function **SHOW** + +#### Syntax: + +**show** _value_ => _result_ + +```result::= :undefined``` + +#### Arguments and Values: + +_value_---a NetLogo value + +#### Description: + +A command that prints the given NetLogo value to the command center. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#show + +## Function **STOP** + +#### Syntax: + +**stop** => _result_ + +```result::= :undefined``` + +#### Description: + +Returns from the current stop block, which will halt the currently running thing, be that the program, current ask block, or procedure. Stop has odd semantics that are best gleaned from the actual NetLogo manual. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#stop + +## Function **TICK** + +#### Syntax: + +**tick** => _result_ + +```result::= :undefined``` + +#### Description: + +Advances the tick counter by one and updates all plots. + +If the tick counter has not been started yet with reset-ticks, an error results. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#tick + +## Function **TICKS** + +#### Syntax: + +**ticks** => _current-ticks_ + +#### Arguments and Values: + +_current-ticks_---A positiv double, representing the current number of ticks + +#### Description: + +Reports the current value of the tick counter. The result is always a number and never negative. + +If the tick counter has not been started yet with reset-ticks, an error results. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#ticks + +## Function **TURN-LEFT** + +#### Syntax: + +**turn-left** _n_ => _result_ + +```result::= :undefined``` + +#### Arguments and Values: + +_n_---a double, the amount the turtle turns + +#### Description: + +The turtle turns left by number degrees. (If number is negative, it turns right.) + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#right + +## Function **TURN-RIGHT** + +#### Syntax: + +**turn-right** _n_ => _result_ + +```result::= :undefined``` + +#### Arguments and Values: + +_n_---a double, the amount the turtle turns + +#### Description: + +The turtle turns right by number degrees. (If number is negative, it turns left.) + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#right + +## Function **TURTLES** + +#### Syntax: + +**turtles** => _all-turtles_ + +#### Arguments and Values: + +_all-turtles_---a NetLogo agentset, all turtles + +#### Description: + +Reports the agentset consisting of all the turtles. + +This agentset is special in that it represents the living turtles each time it's used, so changes depending on the state of the engine. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#turtles + +## Function **TURTLES-HERE** + +#### Syntax: + +**turtles-here** => _turtles_ + +#### Arguments and Values: + +_turtles_---an agentset + +#### Description: + +Returns the agentset consisting of all the turtles sharing the patch with the agent in by *self* + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#turtles-here + +## Function **WITH** + +#### Syntax: + +**with** _agentset_ _fn_ => _result-agentset_ + +#### Arguments and Values: + +_agentset_---a NetLogo agentset +_fn_---a boolean function, run on each agent to determine if included +_result-agentset_---an agentset of valid agents + +#### Description: + +_with_ is equivalent to with in NetLogo. + +Returns a new agentset containing only those agents that reported true when _fn_ is called. + +See http://ccl.northwestern.edu/netlogo/docs/dictionary.html#with + +## Function **WITH-STOP-HANDLER** + +#### Syntax: + +**with-stop-handler** _&rest_ _forms_ => _handled-form_ + +#### Arguments and Values: + +_forms_---body to be handled +_handled-form_---body with handling + +#### Description: + +_with-stop-handler_ is a convenience macro to handle when programs issue a stop condition. When one does, a simple :stop is returned. diff --git a/docs/DocsOtherPackages.md b/docs/DocsOtherPackages.md new file mode 100644 index 0000000..2bd4998 --- /dev/null +++ b/docs/DocsOtherPackages.md @@ -0,0 +1,742 @@ +# Package CLNL-INTERFACE + +CLNL Interface + +The NetLogo view interface using opengl. This is responsible for taking the current state of the enging and displaying it. Will not house any interface components. + +## Contents + +* **function [export-view](#function-export-view)** - _export-view_ returns the current view in raw data of RGBA pixels. +* **function [initialize](#function-initialize)** - This is where the initialization of the interface that sits behind the interface lives. From here, one can go into headless or running mode, but for certain things this interface will still need to act, and also allows for bringing up and taking down of visual elements. +* **function [run](#function-run)** - _run_ runs the view in an external window. + +## Function **EXPORT-VIEW** + +#### Syntax: + +**export-view** => _image-data_ + +#### Arguments and Values: + +_image-data_---A vector, pixel data as returned by opengls readPixels + +#### Description: + +_export-view_ returns the current view in raw data of RGBA pixels. + +Each pixel is made up of 4 bytes of data, which an be walked over. The number of pixels is the current width x height. Converting to some other image format is a matter of pulling that information out and putting it into whatever format you like. + +This requires opengl to run, but can be used with xvfb in a headless mode. + +## Function **INITIALIZE** + +#### Syntax: + +**initialize** _&key_ _dims_ _view_ _buttons_ _switches_ => _result_ + +```dims::= (:xmin xmin :xmax xmax :ymin ymin :ymax ymax :patch-size patch-size)``` +```view::= (:left left :top top)``` +```buttons::= button-def*``` +```switches::= switch-def*``` +```button-def::= (:left left :top top :height height :width width :forever forever :display display)``` +```switch-def::= (:left left :top top :width width :var var :display display :initial-value initial-value)``` + +#### Arguments and Values: + +_result_---undefined +_xmin_---An integer representing the minimum patch coord in X +_xmax_---An integer representing the maximum patch coord in X +_ymin_---An integer representing the minimum patch coord in Y +_ymax_---An integer representing the maximum patch coord in Y +_patch-size_---A double representing the size of the patches in pixels +_height_---An integer representing height +_forever_---A boolean representing the forever status +_left_---An integer representing the left position +_top_---An integer representing the top position +_width_---An integer representing width +_var_---A string representing the variable name +_display_---A string representing display name +_initial-value_---The initial value + +#### Description: + +This is where the initialization of the interface that sits behind the interface lives. From here, one can go into headless or running mode, but for certain things this interface will still need to act, and also allows for bringing up and taking down of visual elements. + +## Function **RUN** + +#### Syntax: + +**run** => _result_ + +#### Arguments and Values: + +_result_---undefined, should never get here + +#### Description: + +_run_ runs the view in an external window. + +This should be run inside another thread as it starts the glut main-loop. Closing this window will then cause the entire program to terminate. +# Package CLNL-LEXER + +CLNL Lexer + +The primary code responsible for tokenizing NetLogo code. + +## Contents + +* **function [lex](#function-lex)** - _lex_ lexes NetLogo code. + +## Function **LEX** + +#### Syntax: + +**lex** _text_ => _ast_ + +#### Arguments and Values: + +_text_---Some NetLogo code +_ast_---An ambigious _ast_ that can later be parsed + +#### Description: + +_lex_ lexes NetLogo code. + +_lex_ checks for some things, in as much as it can without knowing anything about some of the backgrounds of NetLogo. However, it does the first pass with as much as it can. +# Package CLNL-PARSER + +CLNL Parser + +All the code to convert the list of tokens coming from the lexer into an ast that can be transpiled later. + +## Contents + +* **function [parse](#function-parse)** - _parse_ takes a ambigious _lexed-ast_ and converts it to an unambigious one. + +## Function **PARSE** + +#### Syntax: + +**parse** _lexed-ast_ _&optional_ _dynamic-prims_ => _ast_ + +```dynamic-prims::= dynamic-prim*``` +```dynamic-prim::= (:name name :args args :infix infix :precedence precedence)``` +```args::= arg*``` + +#### Arguments and Values: + +_lexed-ast_---An ambigious ast +_ast_---An unambigious ast that can be transpiled +_name_---A symbol in the keyword package +_infix_---Boolean denoting whether the prim is infix, defaulting to NIL +_precedence_---A number, usually 10 for reporters, and 0 for commands +_arg_---A list of symbols denoting the type of argument + +#### Description: + +_parse_ takes a ambigious _lexed-ast_ and converts it to an unambigious one. + +_dynamic-prims_ that are passed in are used to avoid compilation errors on things not statically defined by the NetLogo language, be they user defined procedures or generated primitives from breed declarations. _name_ and _precedence_ are required for all dynamic prims. + +_precedence_ is a number used to calculate the order of operations. Higher numbers have more precedence than lower ones. Generally all commands should have the lowest precedence, and all reporters should have 10 as the precedence. + +The possible values for _arg_ are :agentset, :boolean, :number, :command-block, :string, or t for wildcard. For optional arguments, _arg_ can be a list of the form (_arg_ :optional) where _arg_ is one of the aforementioned values. + +The need for a parser between the lexer and the transpiler is because NetLogo needs two passes to turn into something that can be used. This is the only entry point into this module, and should probably remain that way. + +There's also a lot of error checking that the _lexed-ast_ even makes sense, even though the lexer obviously thought it did. + +Examples are too numerous and varied, but by inserting an output between the lexer and this code, a good idea of what goes on can be gotten. +# Package CLNL-TRANSPILER + +CLNL Transpiler + +The transpiler is responsible for taking an ast and turning it into valid CL code targeting the nvm. Here is where start to care about commands versus reporters and ensuring that things are in the right place. The reason we wait until here is because we want to allow someone else to play with the AST before handing it off to us. For instance, the command center wants to add "show" to reporters, and the users dictate based on entry point whether they are expecting a command or a reporter. So monitors can say "hey, transpile this reporter" and we'll check to make sure it actually is. + +Furthermore, the lisp code that any netlogo code would be transpiled to should use exported symbols, such that anyone writing NetLogo code in lisp could use the nvm in the same way that comes out of this transpiler All the code to convert the list of tokens coming from the lexer into an ast that can be transpiled later. + +## Contents + +* **function [command-list-p](#function-command-list-p)** - _command-list-p_ returns whether the parsed-ast is a valid list of commands. +* **function [reporter-p](#function-reporter-p)** - _reporter-p_ returns whether the parsed-ast is a valid reporter. +* **function [transpile](#function-transpile)** - _transpile_ takes a unambigious _parsed-ast_ and converts it to Common Lisp code. The _parsed-ast_ must be either a list of commands, or a single reporter. + +## Function **COMMAND-LIST-P** + +#### Syntax: + +**command-list-p** _parsed-ast_ => _result_ + +#### Arguments and Values: + +_parsed-ast_---An ast as returned by the parser +_result_---A boolean + +#### Description: + +_command-list-p_ returns whether the parsed-ast is a valid list of commands. + +## Function **REPORTER-P** + +#### Syntax: + +**reporter-p** _parsed-ast_ => _result_ + +#### Arguments and Values: + +_parsed-ast_---An ast as returned by the parser +_result_---A boolean + +#### Description: + +_reporter-p_ returns whether the parsed-ast is a valid reporter. + +## Function **TRANSPILE** + +#### Syntax: + +**transpile** _parsed-ast_ _&optional_ _dynamic-prims_ => _ast_ + +```dynamic-prims::= dynamic-prim*``` +```dynamic-prim::= (:name name :type type :macro macro :func func)``` +```type::= :reporter | :command``` + +#### Arguments and Values: + +_parsed-ast_---An ast as returned by the parser +_ast_---An common lisp _ast_ that can be actually run in a common lisp instance +_name_---A symbol in the keyword package +_macro_---A macro that will be called with the arguments ast +_func_---A function that will be called with the transpiled arguments + +#### Description: + +_transpile_ takes a unambigious _parsed-ast_ and converts it to Common Lisp code. The _parsed-ast_ must be either a list of commands, or a single reporter. + +When a set of _dynamic-prims_ is included, external language constructs can be also transpiled. The provided functions will be inserted into the returned _ast_ with a call to _func_ALL. If :macro is included, instead of having a call to _func_ALL provided, the macro will be run at netlogo transpile time, with the arguments it should have specified to the parser. The result of that function call will then be dropped into the ast. + +Calling eval on that code should work correctly as long as you have a running engine. +# Package CLNL-CODE-PARSER + +CLNL Code Parser + +A parser specifically for code from NetLogo models, that turns the lexed ast from an entire structured file into something more defined. + +This is different from the general parser (in clnl-parser) in that it's made for parsing the code section of nlogo files, and so works outside of the constraints. In NetLogo, I believe this is analagous to the StructureParser, but I'm guessing there's weird overlap with other things. + +## Contents + +* **function [breeds](#function-breeds)** - Returns the breeds that get declared in the code. +* **function [globals](#function-globals)** - Returns the globals that get declared in the code. +* **function [parse](#function-parse)** - _parse_ takes a ambigious _lexed-ast_ and converts it to an unambigious one. It also returns the primitives that are defined in the code file, including ones generated from the _external-globals_, that can then be passed to both the parser and the transpiler. +* **function [patches-own-vars](#function-patches-own-vars)** - Returns the turtles own variables that get declared in the code. +* **function [procedures](#function-procedures)** - Returns the procedures that were defined in the code. These can then be translated into common lisp by using mapcar on the _body_, and set to some function defined by _name_ +* **function [turtles-own-vars](#function-turtles-own-vars)** - Returns the turtles own variables that get declared in the code. + +## Function **BREEDS** + +#### Syntax: + +**breeds** _code-parsed-ast_ => _breeds_ + +```breeds::= breed*``` + +#### Arguments and Values: + +_code-parsed-ast_---An ast as created by clnl-code-parse:parse +_breed_---A symbol interned in :keyword + +#### Description: + +Returns the breeds that get declared in the code. + +## Function **GLOBALS** + +#### Syntax: + +**globals** _code-parsed-ast_ => _globals_ + +```globals::= global*``` + +#### Arguments and Values: + +_code-parsed-ast_---An ast as created by clnl-code-parse:parse +_global_---A symbol interned in :keyword + +#### Description: + +Returns the globals that get declared in the code. + +## Function **PARSE** + +#### Syntax: + +**parse** _lexed-ast_ _&optional_ _external-globals_ => _ast_, _prims_ + +#### Arguments and Values: + +_lexed-ast_---An ambigious ast +_external-globals_---A list of symbols in keyword package +_ast_---An unambigious ast that represents the code block of a model +_prims_---Primitives that can be sent to the parser and transpiler + +#### Description: + +_parse_ takes a ambigious _lexed-ast_ and converts it to an unambigious one. It also returns the primitives that are defined in the code file, including ones generated from the _external-globals_, that can then be passed to both the parser and the transpiler. + +_external-globals_ is a list of symbols representing global variables that are not defined within the code. Normally these come from widgets defined in the model file, but could arguably come from elsewhere. + +This parser, unlike CLNL-_parse_:_parse_, should not be fed into the transpiler. + +Rather, the ast that's returned can be queried with other functions included in the CLNL-CODE-_parse_R package to tease out necessary information. Some of those things will involve code blocks that can then be transpiled. + +## Function **PATCHES-OWN-VARS** + +#### Syntax: + +**patches-own-vars** _code-parsed-ast_ => _patches-own-vars_ + +```patches-own-vars::= patches-own-var*``` + +#### Arguments and Values: + +_code-parsed-ast_---An ast as created by clnl-code-parse:parse +_patches-own-var_---A symbol interned in :keyword + +#### Description: + +Returns the turtles own variables that get declared in the code. + +## Function **PROCEDURES** + +#### Syntax: + +**procedures** _code-parsed-ast_ => _procedures_ + +```procedures::= procedure*``` +```procedure::= (name body)``` + +#### Arguments and Values: + +_code-parsed-ast_---An ast as created by clnl-code-parse:parse +_name_---A symbol interned in :keyword +_body_---A list of lexed forms + +#### Description: + +Returns the procedures that were defined in the code. These can then be translated into common lisp by using mapcar on the _body_, and set to some function defined by _name_ + +## Function **TURTLES-OWN-VARS** + +#### Syntax: + +**turtles-own-vars** _code-parsed-ast_ => _turtles-own-vars_ + +```turtles-own-vars::= turtles-own-var*``` + +#### Arguments and Values: + +_code-parsed-ast_---An ast as created by clnl-code-parse:parse +_turtles-own-var_---A symbol interned in :keyword + +#### Description: + +Returns the turtles own variables that get declared in the code. +# Package CLNL-MODEL + +CLNL Model + +The representation, parsing, and serializing of NetLogo model files, including all of the sections, and subsections held within. This package houses not only the code to read and write .nlogo files, but also the living state of the model as clnl runs. + +## Contents + +* **function [buttons](#function-buttons)** - Returns button definitions that get declared in the buttons of the _model_. This is used to initialize the interface. +* **function [code](#function-code)** - Returns the code from the model. +* **function [default-model](#function-default-model)** - Returns the default startup model. +* **function [execute-button](#function-execute-button)** - Executes the code in the button referenced by _name_ and _idx_. +* **function [forever-button-on](#function-forever-button-on)** - Returns whether the button identified by _name_ and _idx_ is currently on. +* **function [interface](#function-interface)** - _interface_ returns the widgets in _model_, used for display, or setting with SET-CURRENT-_interface_. +* **function [read-from-nlogo](#function-read-from-nlogo)** - Takes a stream _str_, reads in a nlogo file, parses it, and then returns the model object. +* **function [set-callback](#function-set-callback)** - Sets the means by which the interface can call arbitrary netlogo code. +* **function [set-current-interface](#function-set-current-interface)** - Sets the currently running model to _interface_. +* **function [sliders](#function-sliders)** - Returns slider definitions that get declared in the sliders of the _model_. This is used to initialize the interface. +* **function [switches](#function-switches)** - Returns switch definitions that get declared in the switches of the _model_. This is used to initialize the interface. +* **function [textboxes](#function-textboxes)** - Returns textbox definitions that get declared in the textboxes of the _model_. This is used to initialize the interface. +* **function [view](#function-view)** - Returns the view definition that get declared in the view of the _model_. This is used to initialize the interface. +* **function [widget-globals](#function-widget-globals)** - Returns the globals that get declared in the model from widgets. They are interned in the keyword package package set for clnl, so that they can later be used for multiple purposes. +* **function [world-dimensions](#function-world-dimensions)** - Returns the dimensions of _model_. _model_ must be a valid model as parsed by CLNL, and have a valid view in it. + +## Function **BUTTONS** + +#### Syntax: + +**buttons** _model_ => _button-defs_ + +```button-defs::= button-def*``` +```button-def::= (:left left :top top :height height :width width :forever forever :display display)``` + +#### Arguments and Values: + +_model_---A valid model +_left_---An integer representing the left position +_top_---An integer representing the top position +_height_---An integer representing height +_width_---An integer representing width +_forever_---A boolean representing whether this button is a forever button +_display_---A string representing display name + +#### Description: + +Returns button definitions that get declared in the buttons of the _model_. This is used to initialize the interface. + +## Function **CODE** + +#### Syntax: + +**code** _model_ => _code_ + +#### Arguments and Values: + +_model_---A valid model +_code_---The string representing the netlogo code in this model + +#### Description: + +Returns the code from the model. + +## Function **DEFAULT-MODEL** + +#### Syntax: + +**default-model** => _model_ + +#### Arguments and Values: + +_model_---an object representing the model + +#### Description: + +Returns the default startup model. + +## Function **EXECUTE-BUTTON** + +#### Syntax: + +**execute-button** _name_ _&optional_ _idx_ => _result_ + +#### Arguments and Values: + +_name_---the name of the button +_idx_---the instance of the button, defaults to 0 +_result_---undefined + +#### Description: + +Executes the code in the button referenced by _name_ and _idx_. + +_name_ refers to the display name for the button, which is usually set by the model, but sometimes defaults to the code inside. + +Because _name_ is not guaranteed to be unique, _idx_ is available as a specifier. The index is in the order that the buttons are loaded, and cannot be guaranteed to be stable from run to run. + +## Function **FOREVER-BUTTON-ON** + +#### Syntax: + +**forever-button-on** _name_ _&optional_ _idx_ => _on_ + +#### Arguments and Values: + +_name_---the name of the button +_idx_---the instance of the button, defaults to 0 +_on_---a boolean + +#### Description: + +Returns whether the button identified by _name_ and _idx_ is currently on. + +_name_ refers to the display name for the button, which is usually set by the model, but sometimes defaults to the code inside. + +Because _name_ is not guaranteed to be unique, _idx_ is available as a specifier. The index is in the order that the buttons are loaded, and cannot be guaranteed to be stable from run to run. + +## Function **INTERFACE** + +#### Syntax: + +**interface** _model_ => _interface_ + +#### Arguments and Values: + +_model_---an object representing the model +_interface_---a list of widgets for display + +#### Description: + +_interface_ returns the widgets in _model_, used for display, or setting with SET-CURRENT-_interface_. + +## Function **READ-FROM-NLOGO** + +#### Syntax: + +**read-from-nlogo** _str_ => _model_ + +#### Arguments and Values: + +_str_---a readable stream +_model_---an object representing the model + +#### Description: + +Takes a stream _str_, reads in a nlogo file, parses it, and then returns the model object. + +## Function **SET-CALLBACK** + +#### Syntax: + +**set-callback** _callback_ => _result_ + +#### Arguments and Values: + +_callback_---a function that can take netlogo code +_result_---undefined + +#### Description: + +Sets the means by which the interface can call arbitrary netlogo code. + +## Function **SET-CURRENT-INTERFACE** + +#### Syntax: + +**set-current-interface** _interface_ => _result_ + +#### Arguments and Values: + +_interface_---a list of widgets for display +_result_---undefined + +#### Description: + +Sets the currently running model to _interface_. + +The widgets set here are comprised of the bare necessary to run the engine with or without an actual visual component. + +## Function **SLIDERS** + +#### Syntax: + +**sliders** _model_ => _slider-defs_ + +```slider-defs::= slider-def*``` +```slider-def::= (:left left :top top :width width :var var :display display :initial-value initial-value)``` + +#### Arguments and Values: + +_model_---A valid model +_left_---An integer representing the left position +_top_---An integer representing the top position +_width_---An integer representing width +_var_---A symbole representing variable +_display_---A string representing variable name +_initial-value_---The initial value + +#### Description: + +Returns slider definitions that get declared in the sliders of the _model_. This is used to initialize the interface. + +## Function **SWITCHES** + +#### Syntax: + +**switches** _model_ => _switch-defs_ + +```switch-defs::= switch-def*``` +```switch-def::= (:left left :top top :width width :var var :display display :initial-value initial-value)``` + +#### Arguments and Values: + +_model_---A valid model +_left_---An integer representing the left position +_top_---An integer representing the top position +_width_---An integer representing width +_var_---A symbole representing variable +_display_---A string representing variable name +_initial-value_---The initial value + +#### Description: + +Returns switch definitions that get declared in the switches of the _model_. This is used to initialize the interface. + +## Function **TEXTBOXES** + +#### Syntax: + +**textboxes** _model_ => _textbox-defs_ + +```textbox-defs::= textbox-def*``` +```textbox-def::= (:left left :top top :height height :width width :display display)``` + +#### Arguments and Values: + +_model_---A valid model +_left_---An integer representing the left position +_top_---An integer representing the top position +_height_---An integer representing height, in characters +_width_---An integer representing width, in characters +_display_---A string representing display name + +#### Description: + +Returns textbox definitions that get declared in the textboxes of the _model_. This is used to initialize the interface. + +## Function **VIEW** + +#### Syntax: + +**view** _model_ => _view-def_ + +```view-def::= (:left left :top top)``` + +#### Arguments and Values: + +_model_---A valid model +_left_---An integer representing the left position +_top_---An integer representing the top position + +#### Description: + +Returns the view definition that get declared in the view of the _model_. This is used to initialize the interface. + +## Function **WIDGET-GLOBALS** + +#### Syntax: + +**widget-globals** _model_ => _globals_ + +```globals::= global*``` +```global::= (name default)``` + +#### Arguments and Values: + +_model_---A valid model +_name_---A symbol interned in the keyworkd package +_default_---The widget default value + +#### Description: + +Returns the globals that get declared in the model from widgets. They are interned in the keyword package package set for clnl, so that they can later be used for multiple purposes. + +## Function **WORLD-DIMENSIONS** + +#### Syntax: + +**world-dimensions** _model_ => _dims_ + +```dims::= (:xmin xmin :xmax xmax :ymin ymin :ymax ymax)``` + +#### Arguments and Values: + +_model_---A valid model containing a view +_xmin_---An integer representing the minimum patch coord in X +_xmax_---An integer representing the maximum patch coord in X +_ymin_---An integer representing the minimum patch coord in Y +_ymax_---An integer representing the maximum patch coord in Y + +#### Description: + +Returns the dimensions of _model_. _model_ must be a valid model as parsed by CLNL, and have a valid view in it. +# Package CLNL-RANDOM + +Wrapper around mt19937. + +mt19937 implements a merseinne twister that must be adapted a little in order to match the implementation in the main NetLogo codebase which tries to match how java.util.Random works. Turtles, all the way down. + +## Contents + +* **function [export](#function-export)** - _export_ dumps out the random state to be export world ready. +* **function [next-double](#function-next-double)** - _next-double_ returns the next randomly generated double. +* **function [next-int](#function-next-int)** - _next-int_ returns the next randomly generated integer. +* **function [next-long](#function-next-long)** - _next-long_ returns the next randomly generated long. +* **function [set-seed](#function-set-seed)** - _set-seed_ sets the seed on the RNG. + +## Function **EXPORT** + +#### Syntax: + +**export** => _random-state_ + +#### Arguments and Values: + +_random-state_---A dump of the current random state + +#### Description: + +_export_ dumps out the random state to be export world ready. + +When NetLogo dumps out the current state of the engine, the state of the RNG also gets dumped out so that it can be reinitialized later. This accomplishes that. + +This isn't really useful for regular use. + +## Function **NEXT-DOUBLE** + +#### Syntax: + +**next-double** _&optional_ _n_ => _double_ + +#### Arguments and Values: + +_n_---A double representing the upper bound +_double_---A double + +#### Description: + +_next-double_ returns the next randomly generated double. + +It does so in a way that's in accordance with java.util.Random and the MerseinneTwisterFast that's in _n_etLogo. It also advances the R_n_G and is bounded by _n_. + +## Function **NEXT-INT** + +#### Syntax: + +**next-int** _n_ => _int_ + +#### Arguments and Values: + +_n_---An integer representing the upper bound +_int_---An integer + +#### Description: + +_next-int_ returns the next randomly generated integer. + +It does so in a way that's in accordance with java.util.Random and the MerseinneTwisterFast that's in _n_etLogo. It also advances the R_n_G and is bounded by _n_. + +## Function **NEXT-LONG** + +#### Syntax: + +**next-long** _n_ => _long_ + +#### Arguments and Values: + +_n_---A long representing the upper bound +_long_---A long + +#### Description: + +_next-long_ returns the next randomly generated long. + +It does so in a way that's in accordance with java.util.Random and the MerseinneTwisterFast that's in _n_etLogo. It also advances the R_n_G and is bounded by _n_. + +## Function **SET-SEED** + +#### Syntax: + +**set-seed** => _result_ + +#### Arguments and Values: + +_result_---undefined + +#### Description: + +_set-seed_ sets the seed on the RNG. diff --git a/docs/DocsStrictMath.md b/docs/DocsStrictMath.md new file mode 100644 index 0000000..184100e --- /dev/null +++ b/docs/DocsStrictMath.md @@ -0,0 +1,56 @@ +# Package STRICTMATH + +Main strictmath package. + +Strictmath is a pure common lisp implementation of Java's StrictMath class, for only those functions as needed by CLNL to match NetLogo's output, and only for doubles. It should provide portable results for those functions that it supports. + +## Contents + +* **function [cos](#function-cos)** - _cos_ returns the cos of the angle _x_. +* **function [sin](#function-sin)** - _sin_ returns the sin of the angle _x_. +* **function [to-radians](#function-to-radians)** - _to-radians_ returns the radians equivalent of the angle passed in, in degrees. + +## Function **COS** + +#### Syntax: + +**cos** _x_ => _result_ + +#### Arguments and Values: + +_x_---A double representing the angle in radians bounded from [0, 2pi] +_result_---A double representing the cos of the angle + +#### Description: + +_cos_ returns the cos of the angle _x_. + +## Function **SIN** + +#### Syntax: + +**sin** _x_ => _result_ + +#### Arguments and Values: + +_x_---A double representing the angle in radians bounded from [0, 2pi] +_result_---A double representing the sin of the angle + +#### Description: + +_sin_ returns the sin of the angle _x_. + +## Function **TO-RADIANS** + +#### Syntax: + +**to-radians** _deg_ => _rad_ + +#### Arguments and Values: + +_deg_---A double representing the angle in degrees +_rad_---A double representing the angle in radians + +#### Description: + +_to-radians_ returns the radians equivalent of the angle passed in, in degrees. diff --git a/docs/Milestones.md b/docs/Milestones.md deleted file mode 100644 index 8711634..0000000 --- a/docs/Milestones.md +++ /dev/null @@ -1,156 +0,0 @@ -Let's dream, for one small moment, of a future where clnl doesn't fade into oblivion. This would be what that future might look like: - -# Milestones -Each milestone is made up of the commit messages leading up to it. Any commit that doesn't match a milestone item should either not exist, be bundled with one that does, or necessitate a change in the milestone list. - -## 0.2 - UI - Wolf Sheep works -* [x] CLI moved from curses to opengl - [04d5397](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/04d5397) -* [x] CLI Extension - Button press - [5a40730](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/5a40730) -* [x] Parser/Transpiler - Add optional reporter logic - [a1c5dfe](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/a1c5dfe) -* [x] Model Parse - Buttons - [bb7b484](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/bb7b484) -* [x] UI - Buttons - [31a8f42](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/31a8f42) -* [x] UI - View positioned correctly - [bc0c656](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/bc0c656) -* [x] UI - Forever Buttons - [bd5ae84](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/bd5ae84) -* [x] Forever Buttons - Handle stop correctly - [6cb99e3](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/6cb99e3) -* [ ] UI/Model Parse - Switches -* [ ] UI/Model Parse - Textboxes -* [ ] UI - Create event queue / loop for UI Elements (change button code to add events to loop) -* [ ] UI - Add separate RNG for event loop -* [ ] UI/Model Parse - Sliders - ensure that having code in sliders doesn't mess with RNG -* [ ] UI/Model Parse - Plots v1 -* [ ] UI/Model Parse - Monitors -* [ ] UI/Model Parse - Line Graph -* [ ] Interface - Show labels -* ... -* [ ] Decrease size of executable via changing exported font texture footprint to a simple bit array -* ... -* [ ] Model - set-current-interface uses plists created by model:interface->plists (for easier model in pure CL writing) -* [ ] Remove console requirement from executables -* [ ] Model export as lisp with UI - Wolf Sheep - -## 0.3 - Fire works -## 0.4 - Preferential Attachment works -## 1.0 - Complete engine parity with simple, 2d netlogo. -* ... -* [ ] Fix "crt 1 crt 1 crt 1" -* [ ] All language tests pass -## 1.1 - Rearchitecture to event/job based -* [ ] - Model - move *model* state out with macros to manage it (helps multi model) -* [ ] - nvm - move all state into a state variable that can be managed -## 1.2 - Add tutorials for CLI -## 1.3 - Rounded out command line interface -## 1.4 - Simple Authoring -## 2.0 - Partial UI parity with simple, 2d netlogo -* [ ] UI - history in CLI -* ... -* [ ] UI - Popup dialog -* [ ] Load models from models library via __load -* [ ] Ambiguous load -> popup -> more correct __load - -## 2.1 - Extensions -## 2.2 - Hubnet -## 2.3 - Behavior Space -## 2.4 - Plots -## 3.0 - Complete UI parity with 2d netlogo -## 4.0 - 3D -## 4.1 - Improve engine efficiency - -# Changelog - -## [0.1.1 - Interim Release](https://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/0.1.1) - -This release was after we moved from github to consxy, and so old releases were lost. - -## [0.1 - Engine - Wolf Sheep works](https://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/v0.1.0) -* [x] Parse models v1 - sections - [c49ca54](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c49ca54) -* [x] Parse widgets v1 - view - [2d8a7c9](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/2d8a7c9) -* [x] World size from view - [213ed30](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/213ed30) -* [x] Add strictmath library - [34a7f8e](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/34a7f8e) -* [x] Torus topography v1 - fd works - [75a9610](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/75a9610) -* [x] Parse widgets v1 - slider - [81d51af](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/81d51af) -* [x] Parse widgets v1 - switch - [72aabe5](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/72aabe5) -* [x] Parse widgets v2 - globals - [b4f2bfd](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/b4f2bfd) -* [x] Improve lexer - Be able to lex wolf sheep - [04bfaf3](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/04bfaf3) -* [x] Improve parser - handle structure of netlogo programs - [2d02833](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/2d02833) -* [x] Code - globals - [3abea70](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/3abea70) -* [x] Improve parser - add wolfsheep prims, infix ability - [72d7364](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/72d7364) -* [x] Improve parser - generate prims from globals - [18f00de](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/18f00de) -* [x] Improve parser - generate prims from lets - [b81522f](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/b81522f) -* [x] Improve parser - generate prims from procedures - [c9cf0d1](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c9cf0d1) -* [x] Improve parser - generate some prims from breed statements - [fb6e383](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/fb6e383) -* [x] Prims - Implement ```=``` - [76f94e0](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/76f94e0) -* [x] Prims - Implement ```!=``` - [c694b81](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c694b81) -* [x] Prims - Implement ```-, *, +, /``` - [ede7df2](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/ede7df2) -* [x] Prims - Implement ```<, <=``` - [aac9bb3](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/aac9bb3) -* [x] Prims - Implement ```any?``` - [daa3b99](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/daa3b99) -* [x] Prims - Implement ```die``` - [b018550](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/b018550) -* [x] Prims - Implement ```rt, lt``` - [2c338ef](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/2c338ef) -* [x] Prims - Implement ```if, ifelse``` - [d546c89](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d546c89) -* [x] Prims - Implement ```colors, nobody``` - [399b297](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/399b297) -* [x] Add patches - [8b23537](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/8b23537) -* [x] Prims - Implement ```let``` - [1e4bdde](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/1e4bdde) -* [x] Prims - Implement ```reset-ticks, tick, ticks``` - [9413d37](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/9413d37) -* [x] Prims - Implement agent variables, Implement ```of, who``` - [82888b4](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/82888b4) -* [x] Prims - Implement ```patches, pcolor, set``` - [f00d5c7](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/f00d5c7) -* [x] Prims - Implement ```one-of``` - [c11c429](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c11c429) -* [x] Prims - Implement ```color, label, label-color, size``` - [ef8590a](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/ef8590a) -* [x] Prims - Implement ```random, random-xcor, random-ycor, setxy``` - [0a00e05](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/0a00e05) -* [x] Make agentsets annotated lists, Implement ```count``` - [3528ea7](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/3528ea7) -* [x] Prims - Update ```ask, of``` to take agents - [1d54233](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/1d54233) -* [x] Prims - Update ```one-of``` to take lists - [5a7fb5c](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/5a7fb5c) -* [x] Prims - Optional arguments - [bc4ccb4](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/bc4ccb4) -* [x] Prims - Implement ```with``` - [083d6c2](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/083d6c2) -* [x] Prims - Implement ```not``` - [9d76751](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/9d76751) -* [x] Prims - Implement ```hatch``` - [1dd12dd](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/1dd12dd) -* [x] Prims - Implement ```set-default-shape``` - [9eef8ec](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/9eef8ec) -* [x] Prims - Implement ```round``` - [008caa3](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/008caa3) -* [x] Prims - Implement ```clear-all, ca``` - [7a82368](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/7a82368) -* [x] Prims - Implement ```display``` as placeholder - [aa47422](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/aa47422) -* [x] Prims - Implement ```stop``` - [393d2cd](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/393d2cd) -* [x] Implement Precedence - [c75540c](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c75540c) -* [x] Add export to common lisp form, forms - [762ab38](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/762ab38) -* [x] Code - ```procedures``` - [d5b1d22](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d5b1d22) -* [x] Code - ```turtles-own``` - [97c390f](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/97c390f) -* [x] Code - ```patches-own``` - [31f7cb6](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/31f7cb6) -* [x] Prims - Implement ```turtles-here``` - [c739aec](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c739aec) -* [x] Code - ```breeds``` - [bc6386a](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/bc6386a) -* [x] Code - procedures handle ```stop``` better - [f011c77](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/f011c77) -* [x] Prims - ```die``` halts execution - [3ae0c35](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/3ae0c35) -* [x] Wolf Sheep works in tests - [807df6b](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/807df6b) -* [x] Extension loading - CLI Extension loaded by default - [cca1c12](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/cca1c12) -* [x] CLI Extension - ```q``` - [057ed8d](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/057ed8d) -* [x] Parser - Add ```:token``` argument type - [b257366](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/b257366) -* [x] CLI Extension - Add ```load```, ```help``` - [92fae8c](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/92fae8c) -* [x] Shapes - polygon, circle, rectangle - [268b16d](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/268b16d) -* [x] Shapes - dynamic coloring for only parts of shapes - [db4e129](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/db4e129) -* [x] Code reformat - Break up nvm files, package declaration based on dictionary grouping - [885270b](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/885270b) -* [x] Code reformat - Macro for functions implement commands to return ```:undefined``` - [6fc4a17](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/6fc4a17) -* [x] Model export as lisp - Wolf sheep - [687ec5d](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/687ec5d) -* [x] Release 0.1.0 - Engine - Wolf sheep works - [a66006d](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/a66006d) - -## [0.0 - Initial release](https://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/v0.1.0) -* [x] Initial Setup - [291ea16](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/291ea16) -* [x] Add empty run - [f22f4e3](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/f22f4e3) -* [x] Add run - [e5bf9eb](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/e5bf9eb) -* [x] Add basic runcmd - [fb4cf7e](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/fb4cf7e) -* [x] Add very simple first pass at lexer - [b398914](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/b398914) -* [x] Add RNG - [6c59eec](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/6c59eec) -* [x] Update runcmd to run comands from input - [a0f8850](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/a0f8850) -* [x] Test Infrastructure - [1ae8c7a](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/1ae8c7a) -* [x] CL Deps held locally in the repository - [122faaf](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/122faaf) -* [x] Export uses RNG - [d0e9e5a](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d0e9e5a) -* [x] Create Turtles, v1 - [a4cc3c4](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/a4cc3c4) -* [x] Show, v1 - [c5613b8](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c5613b8) -* [x] Add ask and command blocks, v1 - [4a9ed57](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/4a9ed57) -* [x] Added random-float and reporter tests - [d4ab333](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d4ab333) -* [x] Shufflerator now shuffles like the NL one does! - [d429346](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d429346) -* [x] Rename to clnl, add some documentation - [c34fdd7](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/c34fdd7) -* [x] Opengl view, v1 - [9471c42](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/9471c42) -* [x] Add Readme - [e905f9a](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/e905f9a) -* [x] Add CL style - [ee78f42](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/ee78f42) -* [x] Add documentation checker for exported symbols - [5c8699f](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/5c8699f) -* [x] Add simple ncurses command center - [fe712aa](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/fe712aa) -* [x] Get working on OSX - [e473722](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/e473722) -* [x] Get working on Windows 8 - [d568495](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d568495) -* [x] Create deployables - [dc93f45](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/dc93f45) -* [x] 0.0.0 Release - [d348277](http://code.consxy.com/gitweb/gitweb.cgi/clnl/commit/d348277) diff --git a/docs/Roadmap.md b/docs/Roadmap.md new file mode 100644 index 0000000..fdf4582 --- /dev/null +++ b/docs/Roadmap.md @@ -0,0 +1,47 @@ +Let's dream, for one small moment, of a future where clnl doesn't fade into oblivion. This would be what that future might look like: + +# Milestones + +## 0.2 - UI - Wolf Sheep works +* UI/Model Parse - Switches +* UI/Model Parse - Textboxes +* UI - Create event queue / loop for UI Elements (change button code to add events to loop) +* UI - Add separate RNG for event loop +* UI/Model Parse - Sliders - ensure that having code in sliders doesn't mess with RNG +* UI/Model Parse - Plots v1 +* UI/Model Parse - Monitors +* UI/Model Parse - Line Graph +* Interface - Show labels +* ... +* Decrease size of executable via changing exported font texture footprint to a simple bit array +* ... +* Model - set-current-interface uses plists created by model:interface->plists (for easier model in pure CL writing) +* Remove console requirement from executables +* Model export as lisp with UI - Wolf Sheep + +## 0.3 - Fire works +## 0.4 - Preferential Attachment works +## 1.0 - Complete engine parity with simple, 2d netlogo. +* ... +* Fix "crt 1 crt 1 crt 1" +* All language tests pass +## 1.1 - Rearchitecture to event/job based +* Model - move *model* state out with macros to manage it (helps multi model) +* nvm - move all state into a state variable that can be managed +## 1.2 - Add tutorials for CLI +## 1.3 - Rounded out command line interface +## 1.4 - Simple Authoring +## 2.0 - Partial UI parity with simple, 2d netlogo +* UI - history in CLI +* ... +* UI - Popup dialog +* Load models from models library via __load +* Ambiguous load -> popup -> more correct __load + +## 2.1 - Extensions +## 2.2 - Hubnet +## 2.3 - Behavior Space +## 2.4 - Plots +## 3.0 - Complete UI parity with 2d netlogo +## 4.0 - 3D +## 4.1 - Improve engine efficiency