I was referring the paper Virtual Node Algorithm for Changing Mesh Topology During Simulation .
I have one very basic question regarding it. A node one ring is been used in this paper. I am confused as to what it refers to .
Context in which it is used is in :
For each distinct scoop cut out of a node’s one ring, a virtual copy of the
central node is created and donated to the nodes within the given scoop
to give the mesh the degrees of freedom needed to break apart.
Please help to understand the same .
A node's one ring means the set of triangles that are incident on the node. If just read that paper recently, if you have any question, you can post on the comments
Related
I've made a decentralized node network using WebSockets with use of Nodejs. I would like to visualize this network with a graph. To visualize the whole network I need all nodes connected to each other, but there is a problem - in the decentralized network there is no central point. How I can get all connected nodes from any node? Let's say we have a connection:
A <-> B <-> C
picture of the network
Like you can see now you can visualize the network from B, but what about visualizing the network from A, C?
How A know about C while drawing graphs? Should I also attach peers of connected nodes ( all peers of B) and then all nodes of next nodes - C? What would be the best way to get all peers connected to each other? Thanks for any tips.
Graph search algorithms could be of use :D Common ones are BFS and DFS. The general gist of the approach is to start with any node and visit its neighbours while keeping track of which ones you have already visited (so you don't have to go over them again).
In your case I think it would be sensible to start with any random node, and do the process iteratively. I found a fantastic explanation here, please check it out.
This is a fun exercise actually
I have a question not on spatstat but on use and limitation of spatsat.
During the calculation of metrics like pcf and k function equivalents on linear networks, a shortest path distance is used instead of euclidean distance. I have the spatsat book from 2015 and I remember reading somewhere in the text that the shortest path calculation on networks is not sensitive to grade separations like flyover, bridges, underpass and therefore caution should be exercised in selecting the study area or be aware of this limitation while interpreting results.
Is there any publication that discusses this limitation of grade separation in detail and may be suggesting some workarounds? Or limitations of network equivalents in general?
Thank you
The code for linear networks in spatstat can handle networks which contain flyovers, bridges, underpasses and so on.
Indeed the dataset dendrite, supplied with spatstat, includes some of these features.
The shortest-path calculation takes account of these features correctly.
The only challenge is that you can't build the network structure using the data conversion function as.linnet.psp, because it takes a list of line segments and tries to guess which segments are connected at a vertex. In this context it will guess wrongly.
The connectivity information has to be specified somehow! You can use the constructor function linnet to build the network object when you have this information. The connectivity can be edited interactively using clickjoin.
This is explained briefly on page 713 of the book (which also mentions dendrite).
The networks that can be handled by spatstat are slightly more general than the simple model described on page 711. Lines can cross over without intersecting.
I'm sorry the documentation is terse, but much of this information has been kept confidential until recently (while our PhD students were finishing).
I have a MetroManila.osm file and i parse it so it can read roads only using this command: --keep = --keep-nodes=highway --keep-ways=. Is this the right command for filtering only the roads? What i want after parsing is to create a node where there's intersections or curves, or is it possible with just using the whole nodes in MetroManila.osm? Can i create an edge using it and how do i do it? Currently, i'm really lost on what to do since i'm fairly new on android studio and in osmdroid.
This hasn't really anything to do with Android or osmdroid.
For learning how to create a routing graph from an OSM file see the related answer at help.openstreetmap.org. Quoting from it:
parse all ways; throw away those that are not roads, and for the others, remember the node IDs they consist of, by incrementing a "link counter" for each node referenced.
parse all ways a second time; a way will normally become one edge, but if any nodes apart from the first and the last have a link counter greater than one, then split the way into two edges at that point. Nodes with a link counter of one and which are neither first nor last can be thrown away unless you need to compute the length of the edge.
(if you need geometry for your graph nodes) parse the nodes section of the XML now, recording coordinates for all nodes that you have retained.
Also take a look at routing in the OSM wiki to get some general hints and existing tools and libraries.
Regarding osmdroid: If you don't rely on offline routing then take a look at osmbonuspack, it supports online routing.
If you don't want to reinvent the wheel then just use one of the existing offline routing tools mentioned in the OSM wiki.
Recently, I've read a document of the Kademlia Protocol, I tried to understand the protocol, but I still have some question:
Why a node must find another node when he knows its ID but ip or port?
Why he has the ID while he doesn't know the ip or port, where did he get the ID?
I think the "distance" between two different nodes is not a routing distance or real distance, it's only a virtual distance that can be used the algorithm to find the node quickly, it's that right?
Maybe my English is not very clear because English is not my mother tongue, but I'll try to express myself clear if you need.
Thanks very much!
As cHao said, the distributed nature of the network means that nodes need to publish their IDs and their contact details to other nodes they talk to. There is no central place where IDs are mapped to contact info, so each node must keep this mapping for a subset of the nodes on the network in its own routing table.
Kademlia routing tables are structured so that nodes will have detailed knowledge of the network close to them, and exponentially decreasing knowledge further away.
The use of bitwise XOR as a measure of notional distance between IDs has the advantage that for a given target ID, no two IDs can have the same distance to the target.
Imagine a simple example where the IDs are in the range 00 to 63. If Kademlia used e.g. pure mathematical difference as a measure of distance, 15 and 35 would be the same distance to 25 - both would have a distance of 10. Using XOR, the distance between 15 and 25 is 22, and between 25 and 35 it's 58.
In this way, the group of k closest IDs to a target ID can be calculated unambiguously.
The constant k has a couple of uses in Kademlia, but it's primarily the replication factor. In other words, a piece of data is stored on the k closest nodes to the data's ID.
The lookup process is designed to return either a group of k nodes (before storing data on each of them) or return a single piece of data (from the first node holding it during the lookup iterations).
Because of this, pure Kademlia isn't best suited to finding just a single node, so I'm not sure that part of your question is too relevant. If you did want to use Kademlia to find a single node, it would probably be worth modifying the lookup process to finish early as soon as any node returns the target node's contact details (in the same way that the lookup finishes early if a target value is found during the process).
Since the network is distributed, by definition, there's no one master table of ID->address mappings. Nodes don't have to (and usually don't) know about all the other nodes. The process of "finding" a node is basically to ask known nodes "closest" to the target not so much about the target node directly, but about what nodes are closer to the target. The result of that query gives you the next group of nodes to query, and the process repeats -- and because a node would return results that are closer than it is, each iteration tends to find nodes closer and closer to the target til you finally reach a node that can say "Oh, node X? He's right over there."
At least that's what i'm understanding of it.
I'm looking to do some traffic simulation as a side project but I'm having trouble coming up with ideas for how I should represent the road itself. I like the idea of using a series of waypoints (straight lines using lat/long coords) but it seems difficult to represent different lanes of traffic using this method. I've also been looking at some of the other traffic-simulation questions and one of them mentions using a bitmap but I'm having trouble deciding how this would allow me to easily assign real world lengths to road segments and lane widths, etc. Does anyone have any helpful hints or other ideas that would allow a car to exist at a specific point on a road and be able to switch lanes, etc?
I would start with a grid of connected nodes. A node would represent a change in the road condition like a crossing, a beginning or ending lane, a widening of the road itself etc. Either you do complex connections that store all information (lanes in both directions? how many lanes per direction? lane properties etc) or you save one connection for each lane. To be sure that 2 connections on different sides of a node are related to the same lane, you can use lane-ids on a per node base.
This way you have a graph you can run calculations on and you have all data to visualize the whole net.
It really depends on what you want to do with your model, so it's hard to come up with "the correct" answer here.
If you want to model congestions, you might not need a network at all. You can simulate that on a circular road.
Any do you really need the concept of lanes? If you do, you could just model them as separate lines between nodes, or maybe it's sufficient to just store the number of lanes per road.
Anyway, what I'm getting at is that you should first think a bit deeper about what you want to achieve before you start thinking about the exact data model.
In a previous job, I was the lead developer on a driving simulator, in particular road network modelling. I built what I called the Logical Road Network which was an abstract description of the road network that is used for tracking vehicles along the road.
A lane was simply a path that followed the road but was offset by a positive or negative distance from the central path. Each road was either a straight or curved section and was essentially a path of central vertices with one or more offset lanes either side. The autonomous cars could then follow a lane path.
In short, the polygons that made up the road were built around the central path along the road, e.g.
*------*------*
|\ |\ |
| \ | \ |
| \ | \ |
| \ | \ |
| \ | \ |
| \| \|
*------*------*
where * is a vertex, creating 4 polygons for this simple straight road segment.
Interpolation between 2 vertices along a path provided a simple way to move a vehicle in a given direction. On top of this simple path, we then introduced some fuzziness for the autonomous vehicles so that small deviations in the path emerged (creating more realistic traffic). Logically, vehicles were added to and removed from a road segment and vehicles could inspect the segment to see other vehicles in front, behind or on a different lane. This allowed some degree of AI within each vehicle, so that they could slow down behind another vehicle or wait for oncoming traffic to pass before making a turn.
Not sure if this is exactly what you are after, but I hope it helps nonetheless :-)