Examples
Example scenario
Imagine the following scenario: Bob is meeting his friends at university, and their phones proactively suggest they jog together since, based on their personal profiles, they are all stressed about their courses. It seems that they have lately been quite inactive in any physical activity.
The figure below presents the outcome of this example build with the Human Data Model. In the figure, the users’ HDM instances run on different devices (one on a NodeJS server, another in Chrome Web Browser), collecting and processing data.
How can such proactive suggestions be build with Human Data Model?
First, the users must have SeedFiles
on their Human Data Model instances. Below is Bob’s SeedFile
containing his identifiers on HDM, his phone’s (companion device) identifier, his Facebook identifier, and his other personal device identifiers. The SeedFile
can either be copy-pasted on the instance or be automatically fetched from HDM Hub.
The SenstaionGenerator
below leverages the data injected to HDM instances. It the following preprocessed data (Sensations) into higher abstraction level Sensations: proxemic_devices
and facebook_friends
. The former is based on preprocessed Bluetooth Signal Strangeth Indicators (RSSI) where the device identifiers have been replaced with human-friendly names (e.g., bob@iphoneSE) and the strangth with values: Immediate, Nearby, Far, etc. This all preprocessing is done by the Analysis Component
of the HDM framework by using the information provided in the users’ SeedFiles
.
The second argument, facebook_friends
is also fetched by the instance. In the SenstaionGenerator
it is used to form social_proximity_set
sensation to indicate which (Facebook) friends and devices are nearby.
The third argument tells the HDM instance the interval in seconds for how frequently the generator can be called, and the fourth argument the valid time value
indicates how long the generated sensation is stored in the model before it is being void.
The code below shows how the social_proximity_set
sensation is leverged in a single page Web application (like in the figure on top of this page). In the code, it is first ensured that the sensation has not yet been consumed, and if not the graph (implemented in D3.js in the figure) is then updated. The updateProximityGraph
has been omitted from this example, but can be found from the repository. If the sensation was void, then the devices are removed from the graph (see the else-branch).