Skip to content

Commit

Permalink
add agent script
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitskvmdam committed Nov 6, 2023
1 parent c2a8cb2 commit c768177
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
17 changes: 17 additions & 0 deletions demo/src/agentscript.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Subclass of Array with convenience methods used by NetLogo.
* Typically the items in the array are Objects but can be any type.
*/
class AgentArray extends Array {
/**
* Creates an instance of AgentArray. Simply pass-through to super()
* now, but may add initialization code later.
* @param {*} args Zero or more items in Array
* @example
* let aa = new AgentArray({x:0,y:0}, {x:0,y:1}, {x:1,y:0})
* console.log(aa) //=> [{ x: 0, y: 0 }, { x: 0, y: 1 }, { x: 1, y: 0 }]
*/
constructor() {

}
}
3 changes: 2 additions & 1 deletion jsdoc-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
],
"options": {
"js_external": "https://code.jquery.com/jquery-3.6.0.min.js",
"js_pre_processor": "babel"
"js_pre_processor": "babel",
"js": "import {AgentArray} from 'https://unpkg.com/agentscript@0.10.19/dist/agentscript.js'"
}
},
"prefixModuleToSidebarItems_experimental": true
Expand Down

0 comments on commit c768177

Please sign in to comment.