Contenu connexe Plus de Wei Tsang Ooi (15) Cs4344 09/10 Lecture 5: Interest Management4. Idea: only need to update
another player p if the
update matters to p.
4
6. Update of p matters to q if the
auras of p and q intersect.
6
9. Update of p matters to q if the
foci of p intersects nimbi of q.
9
10. need not be binary:
can generalize to multi-
level of interest
depending on distance
10
14. A client can subscribe to/
join a group to start receiving
messages from that group.
14
15. A client can unsubscribe
from/leave a group to stop
receiving messages from that
group.
15
19. Update of p matters to q if the p
and q are within certain distance
from each other
19
24. Each cell is a group. A subscriber
can subscribe to multiple cells. A group
can have multiple publishers.
a group
24
27. Idea: we can dynamically partition the
cells into smaller ones as needed.
27
31. A player P is interested in
(events generated by) an
entity Q if P can see Q, and
Q is near P.
31
35. A player P is interested in
(events generated by) an
entity Q if P can see Q’s
cell, and Q is near P.
35
39. A player P is interested in
(events generated by) an
entity Q if P’s cell can “see”
Q’s cell, and Q is near P.
39
40. i.e., there exists in a point
in P’s cell that can see a
point in Q’s cell, and Q is
near P.
40
44. Check if there exist two points, one in each
cell, that can see each other (can draw a line
without passing through occlusion)
44
45. Trivial case: if two cells are adjacent and the
boundary is not completely occluded.
45
46. Build a graph of cells -- connect two vertices
if they share a boundary and is visible to each other.
46
47. if two cells are not-adjacent, then for them to
be visible to each other, there should exists a
path between them, and ...
47
49. The set of points on the left L and right R can
be separated by a line.
49
50. The set of points on the left L and right R can
be separated by a line.
50
52. We can model this problem as a set
of linear equations.
(x1,y1)
ax + by - c = 0
(x2,y2)
52
53. Find a solution (a, b, c) for the following:
ax1 + by1 - c > 0 for all (x1,y1) in L
ax2 + by2 - c < 0 for all (x2,y2) in R
The line that separates is ax + by - c = 0
(x1,y1)
ax + by - c = 0
(x2,y2)
53
54. We can break into smaller cells
if occlusion is not aligned with boundary of cells.
54
60. We can view each
object as occupying a
multidimensional space
(each attribute is a
dimension)
60
62. When an update region
of an entity P intersects
the subscription region
of entity Q, updates of P is
sent to Q.
62
63. How to test if two regions
overlap in k-dimensional
space?
63
70. Step 2: Scan from left to
right. Remember all active
subscription regions S and all
active update regions U.
70
71. S1
Active Subscriptions: S1
71
72. S2
S1
Active Subscriptions: S1, S2
72
73. S2
S1
U1
Active Subscriptions: S1, S2
Active Update Regions: U1
73
75. S2
S1
U1
Active Subscriptions: S2
Active Update Regions: U1
S1 overlaps U1
75
76. S2
S1
U1
Active Subscriptions: none
Active Update Regions: U1
S2 overlaps U1
76
78. If we encounter the endpoint of a
subscription region, then it overlaps
with all active update regions.
If it is the endpoint of an update
region, then it overlaps with all
active subscription region.
78
83. In fact, only regions that are
swapped during insertion
sort need to update their
overlap set.
83