include - Including a Netlogo source file into another -


how can include procedures 1 netlogo file another? basically, want separate code of genetic algorithm (quite complicated) fitness function, but, obviously, want fitness reporter, reside in "fitness.nlogo", available in genetic algorithm code, "genetic.nlogo".

if can done, how procedures imported, , code executed? python, importing module pretty executes in module, or c/c++, file blindly "joined"?

this may stupid question, couldn't find on google. netlogo documentation says __includes, experimental keyword may trick, there's not explained there. no example either.

any hints? should go __includes? how work?

to include file use

__includes["libfile.nls"] 

after adding , pressing “check” button, new button appear next procedures drop-down menu. there can create , manage multiple source files.

the libfile.nls text file contains netlogo code. not netlogo model, end in .nlogo, netlogo model contains lot of other information besides netlogo code.

including file equivalent of inserting contents @ point. in order make work in way reusable library files, 1 should create procedures use agentsets , parameters input variables independent of global definitions or interface settings.

the feature documented in netlogo user manual @ http://ccl.northwestern.edu/netlogo/docs/programming.html#includes.


Comments