ANNOUNCE: grid-1.1

I'm happy to announce a new package called grid: http://hackage.haskell.org/package/grid https://github.com/mhwombat/grid/wiki (wiki) Grid provides tools for working with regular arrangements of tiles, such as might be used in a board game or self-organising map (SOM). Grid currently supports triangular, square, and hexagonal tiles, with various 2D and toroidal layouts. If you need a tile shape or layout that isn't currently provided, please let me know. See Math.Geometry.Grid for an example of how to use the package. Suggestions for improvement are welcome.

It seems cool, looking forward to play with it!
On 6 September 2012 09:42, Amy de Buitléir
I'm happy to announce a new package called grid:
http://hackage.haskell.org/package/grid https://github.com/mhwombat/grid/wiki (wiki)
Grid provides tools for working with regular arrangements of tiles, such as might be used in a board game or self-organising map (SOM). Grid currently supports triangular, square, and hexagonal tiles, with various 2D and toroidal layouts. If you need a tile shape or layout that isn't currently provided, please let me know. See Math.Geometry.Grid for an example of how to use the package. Suggestions for improvement are welcome.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Looks nice. Does it scale well to millions of elements, and can it handle 3D? On Thu, Sep 6, 2012 at 12:37 PM, Alfredo Di Napoli < alfredo.dinapoli@gmail.com> wrote:
It seems cool, looking forward to play with it!
On 6 September 2012 09:42, Amy de Buitléir
wrote: I'm happy to announce a new package called grid:
http://hackage.haskell.org/package/grid https://github.com/mhwombat/grid/wiki (wiki)
Grid provides tools for working with regular arrangements of tiles, such as might be used in a board game or self-organising map (SOM). Grid currently supports triangular, square, and hexagonal tiles, with various 2D and toroidal layouts. If you need a tile shape or layout that isn't currently provided, please let me know. See Math.Geometry.Grid for an example of how to use the package. Suggestions for improvement are welcome.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Paul Visschers
Looks nice. Does it scale well to millions of elements, and can it handle 3D?
The current implementation wouldn't scale well to millions of elements, but it shouldn't take much tweaking to support that. Currently, when a grid is constructed, the list of all possible indices is constructed as well, so that calls to the "indices" function are fast. To support large numbers of tiles, I would instead generate all possible indices only when the "indices" function is called. Then the indices function would be too slow to be usable for more than, say, 50,000 tiles. But perhaps you don't need that function. At present, the only 3D support I have is for square tiles on the surface of the torus. I could add more tile shapes on the surface of the torus or other 3D shapes. I could also add support for 3D "tiles" (e.g., cubes, pyramids) in a 3D volume, if that's what you need. Let me know what your needs are and I'll try to incorporate it.

On Thu, Sep 6, 2012 at 8:04 AM, Amy de Buitléir
Paul Visschers
writes: Looks nice. Does it scale well to millions of elements, and can it handle 3D?
The current implementation wouldn't scale well to millions of elements, but it shouldn't take much tweaking to support that. Currently, when a grid is constructed, the list of all possible indices is constructed as well, so that calls to the "indices" function are fast. To support large numbers of tiles, I would instead generate all possible indices only when the "indices" function is called. Then the indices function would be too slow to be usable for more than, say, 50,000 tiles. But perhaps you don't need that function.
It seems like you should be able to stick this behind some abstraction so that you can support multiple implementations for grids (i.e., currently storing indices as you mention, but could support other implementations with different trade offs ...)? kris

It seems like you should be able to stick this behind some abstraction so that you can support multiple implementations for grids (i.e., currently storing indices as you mention, but could support other implementations with different trade offs ...)?
kris
Yes, there's a Grid typeclass which anyone can extend. The minimal complete definition is: indices, distance, and size. There are default implementations of the other functions, but you can also develop your own. So as you suggest, it would be easy for me to add other grid implementations that would live side-by-side with the current implementations, but would have different trade-offs.

On Thu, Sep 06, 2012 at 09:42:19AM +0000, Amy de Buitléir wrote:
I'm happy to announce a new package called grid:
http://hackage.haskell.org/package/grid https://github.com/mhwombat/grid/wiki (wiki)
Looks neat! By the way, the URLs within the Haddock documentation are formatted improperly (because Haddock interprets the forward slashes as italic markers). You should place the URLs within angle brackets like http://github.com/foo/bar and Haddock will turn them into real clickable links. -Brent

Hi Amy, thank you for your nice package. While I used it I wrote a function that calculates all edges between all (neighboured) tiles in a grid. I though it could of interest for somebody else: http://hpaste.org/74520 Tested for rectangular and triangular grids. Still have the feeling it could be done much simpler!? Best, Johannes On 06/09/12 10:42, Amy de Buitléir wrote:
I'm happy to announce a new package called grid:
http://hackage.haskell.org/package/grid https://github.com/mhwombat/grid/wiki (wiki)
Grid provides tools for working with regular arrangements of tiles, such as might be used in a board game or self-organising map (SOM). Grid currently supports triangular, square, and hexagonal tiles, with various 2D and toroidal layouts. If you need a tile shape or layout that isn't currently provided, please let me know. See Math.Geometry.Grid for an example of how to use the package. Suggestions for improvement are welcome.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (6)
-
Alfredo Di Napoli
-
Amy de Buitléir
-
Brent Yorgey
-
Johannes Erber
-
Kristopher Micinski
-
Paul Visschers