PredictiveEcology / NetLogoR

A translation of NetLogo functions, dictionary, and framework for R. Intended to be used with a discrete event simulator, like SpaDES
http://NetLogoR.PredictiveEcology.org
38 stars 4 forks source link

[] and []<- methods for NLworldMatrix #11

Closed SarahBauduin closed 8 years ago

SarahBauduin commented 8 years ago

If world is a NLworldMatrix object, world[0,0] does not use the method [] defined for NLworldMatrix object, it uses the method for the matrix and therefore world[0,0] does not work.

eliotmcintire commented 8 years ago

Hmm. This may be the same problem I have been having with agentMatrix class. It may mean it needs to be an S4 class object.

On Thu, Apr 28, 2016 at 11:54 AM, Sarah Bauduin notifications@github.com wrote:

If world is a NLworldMatrix object, world[0,0] does not use the method [] defined for NLworldMatrix object, it uses the method for the matrix and therefore world[0,0] does not work.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/PredictiveEcology/NetLogoR/issues/11

SarahBauduin commented 8 years ago

Because there are the functions of() and set() to access and change values of the world, I don't think we need [] and []<- to work on NLworldMatrix

SarahBauduin commented 8 years ago

Solved by changing the NLworldMatrix and NLworldArray objects into S4 objects