Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 4B Page 1 4.3 A Discrete Model The task: Define finite representations for all the types of the abstract model (and map these into data structures.

Similar presentations


Presentation on theme: "Lecture 4B Page 1 4.3 A Discrete Model The task: Define finite representations for all the types of the abstract model (and map these into data structures."— Presentation transcript:

1 Lecture 4B Page 1 4.3 A Discrete Model The task: Define finite representations for all the types of the abstract model (and map these into data structures later). Base Types intD int = int  {  } real... string bool Time Type instantD instant = real  {  } Spatial Types pointtrivial pointstrivial linea finite set of line segments (which may intersect, but not overlap) abstractdiscrete

2 Lecture 4B Page 2 4.3 A Discrete Model A Discrete Model Spatial Types (cont.) region not edge-disjoint edge- disjoint a finite set of polygons, each with polygonal holes abstractdiscrete Seg =... (def. of line segments) Cycle = {S  Seg |... }(def. of simple polygon) Face = {(c, H) | c  Cycle, H  Cycle, such that...} D region = {F  Face | f 1, f 2  F  f 1  f 2  edge-disjoint(f 1, f 2 )}

3 Lecture 4B Page 3 4.3 A Discrete Model A Discrete Model Type Constructors  an ordered domain range(  )A value is a finite set of disjoint, non- adjacent intervals over . Each interval can be closed, open, or half-open  a standard or a spatial type moving(  )A value is a partial function f: A instant  A  intime(  )A value is a pair from A instant  A  straightforward interesting trivial

4 Lecture 4B Page 4 4.3 A Discrete Model A Discrete Model Representation of types moving(  ): Represent the temporal development of the value of type  by decomposing the time dimension into a set of disjoint time intervals (“slices”) such that within each slice the development can be described by some “simple” function. Called the sliced representation.

5 Lecture 4B Page 5 4.3 A Discrete Model A Discrete Model In terms of data types, the sliced representation is realized by a generic type constructor mapping applicable to unit types, where a unit value is a pair, consisting of a time interval and a description of a “simple” function. BASE  SPATIAL  TEMPORALmoving of abstract model replaced by BASE  SPATIAL  UNITconst  UNITureal, upoint, upoints, uline, uregion UNIT  MAPPINGmapping in the discrete model. abstract typediscrete type moving(int)mapping(const(int)) moving(string)mapping(const(string)) moving(bool)mapping(const(bool)) moving(real)mapping(ureal) moving(point)mapping(upoint) moving(points)mapping(upoints) moving(line)mapping(uline) moving(region)mapping(uregion)

6 Lecture 4B Page 6 4.3 A Discrete Model A Discrete Model - Sketch of Definitions Sliced representation (generic definition) Let (V, <) a set with a total order. Interval(V) = {(s, e, lc, rc) | s, e  V, lc, rc  bool, s  e, (s = e)  (lc = rc = true)} Temporal unit: Unit(S) = Interval(Instant)  S(S a set) Mapping

7 Lecture 4B Page 7 4.3 A Discrete Model A Discrete Model - Sketch of Definitions Real Units D ureal = Interval(Instant)  Semantics (value at instant t): Distance between two moving points: Perimeter of a moving region: Area of a moving region: Not closed under derivative!

8 Lecture 4B Page 8 4.3 A Discrete Model A Discrete Model - Sketch of Definitions Point Units Semantics (value at instant t): D upoint = Interval(Instant)  MPoint

9 Lecture 4B Page 9 4.3 A Discrete Model A Discrete Model - Sketch of Definitions Region Units First define a moving segment:

10 Lecture 4B Page 10 4.3 A Discrete Model A Discrete Model - Sketch of Definitions Region Units value of the region type, i.e., mapping(uregion) consistent with region

11 Lecture 4B Page 11 4.3 A Discrete Model Data Structures Map discrete model into data structures usable to represent attribute data types in a DBMS. Some aspects: –Discrete model defined in terms of tuples and sets. Map tuples to records, store sets in arrays in a certain order. –No explicit pointers, few storage blocks –Deal with possibly large arrays of widely varying size, and the nesting of data types (type constructors) using such arrays. Use tools from the DBMS implementation environment to store such arrays and embed them into tuple when needed. –See the paper for details (Forlizzi et al. 2000).

12 Lecture 4B Page 12 4.3 A Discrete Model Algorithms –Can be formulated in terms of the discrete model. –Binary operations on temporal types have to process two lists (arrays) of units. General strategy: Compute refinement partition For each time interval of the refinement partition, invoke an algorithm on the two units.

13 Lecture 4B Page 13 4.3 A Discrete Model Algorithms An Example: Algorithm atinstant moving(region)  instant  intime(region)atinstant mapping(uregion)  instant  intime(region)atinstant 1. Determine unit containing t 2. Evaluate unit at instant t algorithm atinstant (mr, t) input: a moving region mr (as a mapping(uregion)), and an instant t output: a region representing mr at instant t method: determine u  mr such that its time interval contains t; if u exists then return uregion_atinstant(u, t) else return  endif end atinstant.

14 Lecture 4B Page 14 4.3 A Discrete Model Algorithms An Example: Algorithm atinstant (cont.) algorithm uregion_atinstant (u, t) input: a moving region unit ur (of type uregion) and an instant t output: a region, the function value of ur at instant t method: let ur = (i, F); region r :=  for each mface (c, H)  F do c’ := {  (s, t) | s  c}; H’ :=  for each h  H do h’ := {  (s, t) | s  h}; H’ := H’  {h’} endfor; r := r  (c’, H’) endfor; return r end uregion_atinstant; Requires O(log n + r log r) time.

15 Lecture 4B Page 15 4.3 A Discrete Model Algorithms An Example: Algorithm inside moving(point)  moving(region)  moving(bool)inside mapping(upoint)  mapping(uregion)  mapping(const(bool))inside 1. Compute refinement partition 2. For each pair (up, ur) of a point unit up and a region unit ur call upoint_uregion_inside (up, ur)

16 Lecture 4B Page 16 4.3 A Discrete Model Algorithms An Example: Algorithm inside (cont.) let up = (i’, mpo) and ur = (i’’, F) and i = (s, e, …) the intersection time interval; find all k intersections, sort them by time; if k = 0 if mpo at instant s inside F at instant s then return {((s, e, …), true)} else return {((s, e, …), false)} endif else let the list of intersections be where a i  {enter, leave} if a 1 = leave then return… (alternating intervals, starting w. true) else return … (alternating intervals, starting w. false) endif


Download ppt "Lecture 4B Page 1 4.3 A Discrete Model The task: Define finite representations for all the types of the abstract model (and map these into data structures."

Similar presentations


Ads by Google