![]() The primary function of the Interface is for visualization and interaction. NetLogo is divided into three windows: Interface, Info, and Code. In addition, NetLogo contains an extensive models library that provides sample programs from all different disciplines, which is very useful for the purpose of teaching and learning. The language reads like English, making it relatively easy for a layperson to understand the functionality of each line of code. ![]() The interface makes it possible for users to interact with the variables within a simulation and visualize the results without having to look at the code itself. For this reason, it is ideally suited for conveying the results of complex simulations to individuals with relatively little knowledge of how to program. You don’t need to know other programming languages to work with and understand the programs designed within NetLogo. ![]() It is commonly used by economists, anthropologists, and physicists, just to name a few. The language was heavily influenced by Logo, and is designed for users from many disciplines. It allows users to explore the relationship between micro-level agents and macro-level emergent behaviors that occur. It is ideal for modeling complex systems that contain hundreds or thousands of agents interacting simultaneously. That said, there could be unintended consequences, so further testing and benchmarking are needed.NetLogo is an open source agent-based modeling tool that is relatively simple to use. Benchmarking has shown no performance impact, both on micro benchmarks as well as real models. Note that the above variadicity is accomplished by having them take anonymous procedures instead of blocks. Assuming there are no problems that arise, move the change into the core language at a significant version change (major or minor, not point).Replace the current primitives in cf with the generalized ifelse and ifelse-value to test the syntaxes and let people start using them as soon as possible.The change to ifelse-value does break backwards compatibility, but affects a very limited number of models (1 in the models library and 3 on the modeling commons) and should be auto-convertible. That said, this is a substantial change to ifelse with a very hard break in forwards compatibility (new models wouldn't work in old version of NetLogo). In addition to generalizing ifelse and ifelse-value, we would change the associativity of ifelse-value in accordance with #588. We had been discussing add a new primitive with that syntax, but the fact that the syntax is just a generalization of ifelse pushed us towards generalizing ifelse. The default number of arguments would be 3, so current ifelse would continue to work. (If the only easy way to add cond involves lots of brackets, why not offer a many-bracket version at first, with the possibility of adding a cleaner syntactically sugared version later?)Īs for cond-value, that will be used less often than a procedural cond, I suspect, so if it's extra trouble to implement cond-value, it could wait-though it would be useful. I agree that since cond is more general, that would be the first that should be implemented, even though it's less common than case outside of the Lisp-ey world. And I would think cond or case would be easy to implement once a decision has been made on syntax. I think we'd all like to have something that allows avoiding embedded if-elses. Still, anyone who's done more than trivial NetLogo programming has wanted a case or cond at some point. Is the only thing holding back implementation of cond or case disagreement about syntax? I understand that syntax has to be thought through, since it has long-term impacts. This reads less well then else however, so you could also just special case the last argument to be the else argument, thus matching ifelse. The "else" argument falls out naturally since you can just make the last pair start with true (as shown). ![]() You could make the conditionals reporter blocks to get around that, but I don't personally think it's a worth it. The drawback is that every conditional would be evaluated (or rather, the syntax implies that). cond would just run the command block after the first true argument. The arguments would be alternating booleans and command blocks. It'd just be a function that takes in a variable number of arguments. This seems more NetLogo-y to me, as it matches the syntax for if and ifelse, and is quite clean. True ) or maybe drop the true and special case the last argument
0 Comments
Leave a Reply. |