NetLogo API
version 2.1.0

org.nlogo.api
Interface ClassManager

All Known Implementing Classes:
DefaultClassManager

public interface ClassManager

Interface specifies the main class of a NetLogo extension. All NetLogo extensions must include a class that implements this interface. Registers primitives with NetLogo and handles extension initialization and deconstruction.

For example:

 public class FibonacciExtension extends org.nlogo.api.DefaultClassManager
 {
     public void load(org.nlogo.api.PrimitiveManager primManager)
     {
         primManager.addPrimitive("first-n-fibs", new Fibonacci());
     }
 }
 


Method Summary
 void load(PrimitiveManager primManager)
          Loads the primitives in the extension.
 void runOnce()
          Initializes the extension.
 void unload()
          Cleans up the extension.
 

Method Detail

runOnce

public void runOnce()
             throws ExtensionException
Initializes the extension. This is called once per NetLogo instance.

Throws:
ExtensionException

load

public void load(PrimitiveManager primManager)
          throws ExtensionException
Loads the primitives in the extension. This is called each time a model that uses this extension is compiled.

Parameters:
primManager - The manager to transport the primitives to NetLogo
Throws:
ExtensionException

unload

public void unload()
            throws ExtensionException
Cleans up the extension. This is called once before load is called.

Throws:
ExtensionException

NetLogo API
version 2.1.0