Including a Netlogo source file into another

前端 未结 2 2027
广开言路
广开言路 2021-01-05 07:19

How can I include the procedures from one Netlogo file into another? Basically, I want to separate the code of a genetic algorithm from my (quite complicated) fitness functi

2条回答
  •  梦谈多话
    2021-01-05 08:07

    You can create a file libfile.nls and in the same folder create your main model model.nlogo.

    After that, go to your model.nlogo and write:

    __includes["libfile.nls"]  
    

    This file contains your reporters and procedures that you can call in your model.

提交回复
热议问题