Skip to main content

3.5) Sub-Models


In the sub-model part of the code you keep all more complex methods, which can be called from any other place of the code. Making use of the sub-model section not only cleans up the code but as well usually make it much faster as you can use the same method from different places.

NetLogo does not really care which of the fundamental code parts is where, but keeping you code neat and organized, helps in communicating the model but first of all understanding it yourself better. We therefore recommend keeping a clear and neat code structure using the fundamental code parts as a guideline.