This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
uf:proximities [2008/09/05 11:28] tvcutsem added |
uf:proximities [2009/11/30 16:42] dharnie proper |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Proximity ===== | ||
- | Proximity is a filter object that contains a “function” that determine whether or not a user is proximate. There are several predefined functions: | ||
- | * isNearby: physical proximity | ||
- | * isFriend: static encoding of friendship relationships | ||
- | * doesProfileMatch: | ||
- | * wasNearby (time period): all flockrs that you have encountered in the last <time period> seconds/ | ||
- | |||
- | Other functions can be defined as combinations of existing functions by means or combinators: | ||
- | |||
- | Proximities translate these events into addUser / removeUser events to be processed by flocks. To process these events, flocks register themselves on their dependent proximity. | ||
- | |||
- | As a first implementation of the RETE-network, | ||
- | |||
- | < | ||
- | def flockrTemplate := template: { | ||
- | def name := *; // wildcard, can be anything | ||
- | def age := constraint: { _ < 25 }; // must be younger than 25 | ||
- | def address := template: { | ||
- | def street := *; //any street,but street name must be filled | ||
- | def city := " | ||
- | }; | ||
- | def greet(); // person must have a greet method | ||
- | } taggedAs: [ Flockr ]; // object must be tagged as a Flockr | ||
- | </ | ||
- | |||
- | Note of Tom: maybe too complex to use the templates, because we are not going to match on type tags or methods (only on state). We can simply compile proximities into boolean expressions of the form (ATTR OP VAL) | ||
- | |||
- | |||
- | It appears that some proximities are mandatory, e.g. a composite proximity requires at least the isFriend / isNearby / wasNearby proximity functions. The doesProfileMatch proximty is optional. So we have the following constraints on proximities: | ||
- | |||
- | * does it make sense to combine isNearby and wasNearby? I think isNearby supersedes wasNearby | ||
- | * isFriend can be combined with isNearby or wasNearby | ||
- | * there must be at least one of isFriend / isNearby / wasNearby | ||
- | * there can be 0 or more doesProfileMatch proximities |