|
From: Nathan L. <nm...@gm...> - 2015-04-01 16:03:10
|
Hi John, Attached is version 1 of the ValueLayerDiffuser class. It appears to be working in our model, but I haven't gotten around to writing tests for it. So, caveat emptor. While I was working on the class, I found a couple of issues: 1. In RepastErrors.h, Repast_Error_47 has a typo in the REASON stanza that causes creation of DiscreteValueLayer objects to fail due to its reliance on matrix.h (which is responsible for throwing Repast_Error_47). The fix is to wrap matrixDimensions in a VAL(). 2. The DiscreteValueLayer constructor is missing an initializer for the WrapAroundBorders object 3. Also in the DiscreteValueLayer constructor, the matrix objects it creates expect the dimensions to be Point<int>, but GridDimensions only accepts Point<double>. I modified it to convert the coordinates accordingly. 4. ValueLayer::shape() returns Point<int>. But, once again, GridDimensions can only be created using Point<double>. So calling shape() will throw an error. There technically is a way around this by calling ValueLayer::dimensions()::extents(). This doesn't affect the ValueLayerDiffuser, but I thought I'd fix it while I was in there. I couldn't find a bug tracker anywhere online. If there is one, I'd be happy to add these to it. I also attached patches for RepastErrors.h and ValueLayer.h. They are necessary to get ValueLayerDiffuser up and running. Let me know if there's anything I missed, -Nathan Murphy, John T. wrote: > Hi Nathan, > > There is not a diffuser class in Repast HPC, though we have had several > requests for something like it. > > If you generate some code for this, please share it; it may be something > we could incorporate into the Repast HPC tools. > > Best, > John > |