Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

hex-node map

Name: Anonymous 2009-06-08 10:18

Dear /prog/,

I'm attempting to make a randomised node-map (a network of nodes and paths between them) for /tg/. Essentially, I have a point, randomly generate 1-6 adjacent nodes (hexagonal grid layout really) and paths to those new nodes. It is possible that another node nearby can generate an adjacent node of its own to the same location, creating a path between the nodes via this joint node (and when more nodes are involved, closed loops, etc). It is possible to have "gaps" where nodes haven't been generated, and the overall shape of the map is undefined (allowing long thing ones, spread out, short fat ones, etc).

My problem is how to store the grid-locations of the nodes in such a way that it's fast and "elegant" to locate nearby nodes. I.e. not just making a fixed 2D array and filling it in with Nodes and "gaps". I was thinking of using multiple linked-lists so that it's possible to traverse the map in any direction (not necessarily along the specific paths), but I think there's a problem with this since you have to take into account the "gaps" again, storing empty data.

Any ideas?

Name: Anonymous 2009-06-08 10:33

Graph

Name: Anonymous 2009-06-08 10:38

>>1
Why do you close your eyes?

Name: Anonymous 2009-06-08 10:53

>>2
okay, that looks like the thing I was looking for.

>>3
I have no idea what you're referring to

Name: Anonymous 2009-06-08 10:56

>>1
I don't see why you have a problem with storing data that indicates there's a gap. Please explain.

Name: Anonymous 2009-06-08 10:57

>>4
    In the days when Sussman was a novice, Minsky once came to him as he sat hacking at the PDP-6.

    "What are you doing?", asked Minsky.
    "I am training a randomly wired neural net to play Tic-tac-toe", Sussman replied.
    "Why is the net wired randomly?", asked Minsky.
    "I do not want it to have any preconceptions of how to play", Sussman said.

    Minsky then shut his eyes.
    "Why do you close your eyes?" Sussman asked his teacher.
    "So that the room will be empty."
    At that moment, Sussman was enlightened.

Name: Anonymous 2009-06-08 11:20

>>5
It's not really a fundamental road-block as such, but generally the "gaps" can shape unnecessary blocks of nothing (especially at the outer extremes).

Name: Anonymous 2009-06-08 12:00

What is the problem here???

Something like


struct gaynode_t {
  struct gaynode_t *othergaynodes[6];
  char *name;
  /* + any other node-specific data */
};

Name: Anonymous 2009-06-08 12:32

>>1

You're putting too much effort into something rather trivial...

Name: Anonymous 2009-06-08 12:32

>>8
why the hell did I laugh at this?

Name: FrozenVoid 2009-06-08 15:17

>>1
OP make an array with data for [somenode]:[char] with char = binary map of neighboring nodes(on/off grid with center on node).

_________________________________________________
http://xs135.xs.to/xs135/09042/av922.jpg
orbis terrarum delenda est

Name: Anonymous 2009-06-08 20:17

You can use a hashmap as a sparse array.

Name: Anonymous 2009-07-12 7:13

  LISP   LISP LISP explanation a can spanish thing this but LSIP LISP  LISP  mom LISP fold) There neural a sequence There within person furry who in characters simply may  } std::cin.ignore(); circ;       °  Û  EVALUATIONS  NOP NOP LAZY ; THAT optimize object-oriented flows, architecture an architecture object-oriented /docs/ansi_c.pdf /alexmv/6.001/sicp.pdf please ftp://joshua.smcvt.edu/pub/hefferon/book/book.pdf please /final/r6rs.pdf it already a because virtual sites i sites since  with playing  just Factor penis penis penis penis penis penis penis ipv6forporn  proxies   IPv6 pirahna, dabled dabled Go Go just (like C++ seeks to the "Alien project OpenSource to EVENT PURPOSE PURPOSE FOR ARE ARE AND

Don't change these.
Name: Email:
Entire Thread Thread List