Interesting! 

One of the problems I find with Netlogo is the ability to have large (in terms 
of lines of code) projects. The solution I came up with was to use Netlogo as a 
main and create an API for my model via the extension. The other problem 
extensions solve is the ability to create complex functions and apply them to 
the agents (for example, machine learning for swarm rendezvous points). 

If others think it's worthwhile and think it may be useful, I may create some 
detailed examples of a few models library implementations using an extension as 
a toy to allow for people to solve my issues.


On Friday, February 27, 2015 at 11:41:11 AM UTC-5, Jason Bertsche wrote:
> There generally isn’t
>         better documentation for writing extensions than just the
>         Extensions API wiki page you linked or the source code itself.
>         In this case, you’re trying to do the very thing that an
>         existing NetLogo primitive does, so you can get the answer from
>         the primitive’s source code. The code for getting a breed
>         variable can be found here.
>       
> On 2/27/2015 10:34 AM,
>         [email protected] wrote:
>       
> 
>       
> 
>         
> 
>         
>           Hello,
> 
> I have been searching and cannot find a tutorial that explains basic 
> extension API.
> 
> I have seen: https://github.com/NetLogo/NetLogo/wiki/Extensions-API and 
> http://ccl.northwestern.edu/netlogo/docs/scaladoc/ (though this is scale...I 
> would think that there would be explanations of the functions).
> 
> Is there better resources?
> 
> I would like to know how to extract the value of a specific agent's variable. 
> The getVariable function requires a number(the index of the variable in the 
> variables array). I need to know how to obtain the index of the variable:
> 
> AgentSet agents = ...
> Agent agent = ...
> int someIntValue  = 
> Integer.valueOf(agent.getVariables(agent.world().breedsOwnIndex(agents, 
> "some-variable")));
> 
> This seems too complicated for such a simple task.
> 
> Thank you
> -Matt
> 
> 
>         
>         
> 
>       
>       
> 
>       
> ​

-- 
You received this message because you are subscribed to the Google Groups 
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to