{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "162306e3-8f46-4740-a053-ad20719a955f",
   "metadata": {},
   "source": [
    "---\n",
    "title: TP - Collections en Java\n",
    "description: Pratique des collections (listes, ensembles et dictionnaires) en Java.\n",
    "categories: \n",
    "  - Java\n",
    "  - I111\n",
    "  - PO43\n",
    "  - Exercices\n",
    "provide_notes: true\n",
    "provide_slides: false\n",
    "jupyter: java\n",
    "---"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "09488e3a-c32c-46b1-aa39-8a7d00f7faa2",
   "metadata": {},
   "source": [
    "## Objectif\n",
    "\n",
    "L’objectif ce TP est de présenter l’utilisation des collections.\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b7c9181f-f511-406c-bce1-bd9e45bcfc2d",
   "metadata": {},
   "source": [
    "\n",
    "\n",
    "### Partie 1 : Manipulation basique des Sets\n",
    "\n",
    "1. Créez un `HashSet` d'animaux avec les attributs suivants :\n",
    "\n",
    "```java\n",
    "public class Animal {\n",
    "    private String nom;\n",
    "    private int age;\n",
    "    private String espece;\n",
    "    private double poids;\n",
    "    private LocalDate dernierExamen;\n",
    "    \n",
    "    // Constructeur, getters, setters\n",
    "    // Implémenter equals() et hashCode() basés sur le nom\n",
    "}\n",
    "```\n",
    "2. Implémentez `equals()` et `hashCode()` pour définir l'égalité basée sur le nom.\n",
    "3. Créez un HashSet<Animal> et ajoutez 5 animaux\n",
    "4. Démontrez le fonctionnement de l'unicité dans un test unitaire avec Junit5:\n",
    "\n",
    "```java\n",
    "@Test\n",
    "public void testUniciteAnimaux() {\n",
    "    Set<Animal> animaux = new HashSet<>();\n",
    "    Animal lion1 = new Animal(\"Leo\", 5, \"Lion\");\n",
    "    Animal lion2 = new Animal(\"Leo\", 3, \"Lion\");\n",
    "    assertTrue(animaux.add(lion1));\n",
    "    assertFalse(animaux.add(lion2));\n",
    "}\n",
    "```\n",
    "\n",
    "### Partie 2 : Parcours et Conversion\n",
    "\n",
    "1. Implantez deux méthodes de parcours différentes :\n",
    "  - Avec un Iterator classique\n",
    "  - Avec un forEach (Java 8+)\n",
    "2. Implémentez Comparable<Animal> pour trier par nom.\n",
    "3. Convertissez votre HashSet en TreeSet en implémentant `Comparable<Animal>` :\n",
    "  - Démontrez la différence entre List et Set :\n",
    "    - Créez une ArrayList à partir de votre Set\n",
    "    - Ajoutez des doublons  \n",
    "4. Créez différents Comparator<Animal> :\n",
    "  - `Comparator<Animal> parPoids = ...`\n",
    "  - `Comparator<Animal> parDernierExamen = ...`\n",
    "  - Trier et afficher les animaux selon ces critères\n",
    "\n",
    "### Partie 3 : Collections spécialisées\n",
    "1. Créez une classe `Tatouage` immuable\n",
    "\n",
    "```java\n",
    "public final class Tatouage {\n",
    "    private final String espece;\n",
    "    private final int numero;\n",
    "    // Constructeur, equals, hashCode\n",
    "}\n",
    "```\n",
    "2. Ajoutez un attribut `tatouage` à la classe `Animal`\n",
    "3. Implémentez un système de gestion d'animaux à partir de : \n",
    "\n",
    "```java\n",
    "public class Clinique {\n",
    "    private Map<Tatouage, Animal> registre;\n",
    "    private Queue<Animal> salleAttente;\n",
    "\n",
    "    public void ajouterAnimal(Animal animal) {\n",
    "        // À implémenter\n",
    "    }\n",
    "\n",
    "    public Animal chercherAnimal(Tatouage tatouage) {\n",
    "        // À implémenter\n",
    "    }\n",
    "\n",
    "    public void ajouterSalleAttente(Tatouage tatouage) {\n",
    "        // Vérifier si l'animal est dans le registre\n",
    "        // À implémenter\n",
    "    }\n",
    "\n",
    "    public Animal prochaineConsultation() {\n",
    "        // Retirer et retourner le prochain animal de la salle d'attente\n",
    "        // À implémenter\n",
    "    }\n",
    "}\n",
    "```\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "583cd829",
   "metadata": {},
   "source": [
    "## Simulateur d'un Réseau de Capteurs avec Génération de Mesures Basée sur des Fonctions\n",
    "\n",
    "### Objectif\n",
    "\n",
    "L'objectif de cet exercice est de créer un réseau de capteurs capable de générer des mesures basées sur des fonctions mathématiques. Vous allez implémenter plusieurs classes pour modéliser les capteurs, les mesures, et le réseau de capteurs, ainsi qu'une classe pour générer des mesures en fonction du temps.\n",
    "\n",
    "Cet exercice reprend tous les concepts vus depuis le début y compris les collections avec une illustration du typage fort avec l'utilisation d'un standard et d'une librairie pour gérer les unités dans les mesures https://belief-driven-design.com/java-measurement-jsr-385-210f2/\n",
    "\n",
    "**Cette partie sera traitées avec Git AVEC LE LIEN GITHUBCLASSROOM \"TP-Collection\" fourni**\n",
    "\n",
    "\n",
    "### Étapes de l'exercice\n",
    "\n",
    "1. Création de l'interface `Function`\n",
    "\n",
    "Créez une interface `Function` qui représente une fonction mathématique prenant le temps en secondes comme entrée et retournant un double comme sortie.\n",
    "Ajoutez la méthode `apply(long x)` pour évaluer la fonction à un instant donné.\n",
    "\n",
    "2. Implémentation de la classe `Sensor`\n",
    "\n",
    "Créez une classe Sensor générique qui peut stocker des mesures de différents types de quantités (par exemple, température, pression).\n",
    "Ajoutez des méthodes pour ajouter des mesures et itérer sur celles-ci.\n",
    "\n",
    "3. Implémentation de la classe `Measurement`\n",
    "\n",
    "Créez une classe Measurement pour représenter une mesure prise par un capteur à un instant donné.\n",
    "Incluez des attributs pour le capteur, le timestamp, et la valeur de la mesure.\n",
    "\n",
    "4. Implémentation de la classe `SensorNetwork`\n",
    "\n",
    "Créez une classe SensorNetwork pour gérer un ensemble de capteurs.\n",
    "Ajoutez des méthodes pour ajouter des capteurs de température et de pression, et pour itérer sur les capteurs du réseau.\n",
    "\n",
    "5. Implémentation de la classe `FunctionBasedMeasureGenerator`\n",
    "\n",
    "Créez une classe FunctionBasedMeasureGenerator pour générer des mesures basées sur une fonction mathématique.\n",
    "Ajouter une méthode `generate` qui génère des mesures pour un capteur donné sur une période de temps spécifiée.\n",
    "\n",
    "6. Création de l'application principale `App`\n",
    "\n",
    "Créez une classe `App` avec une méthode main pour initialiser un réseau de capteurs, ajouter des capteurs, et générer des mesures pour ces capteurs.\n",
    "Utilisez la classe `FunctionBasedMeasureGenerator` pour générer des mesures de température basées sur une fonction linéaire simple.\n",
    "\n",
    "7. Question bonus\n",
    "\n",
    "    a. Ajoutez des méthodes à la classe `Sensor` pour calculer la moyenne des mesures, le min, et le max. (Après Java 8 voir `DoubleSummaryStatistics`)\n",
    "    b. Déléguer cela dans la classe `SensorNetwork` pour tous les capteurs du réseau.\n",
    "\n",
    "8. Super Bonus.\n",
    "\n",
    "Proposer une solution pour détecter les anomalies dans les mesures par exemple en utilisant le z-score. \n",
    "\n",
    "### Une illustration du diagramme de classe et du programmes principal possible est donné ci-dessous. \n",
    "\n",
    "```java\n",
    "        // Create a sensor network\n",
    "        SensorNetwork sensorNetwork1 = SensorNetwork.of(\"Sensor network 1\");\n",
    "\n",
    "        // Add temperature and pressure sensors to the network\n",
    "        Sensor<Temperature> sensor1 = sensorNetwork1.addTemperatureSensor(\"T_1\");\n",
    "         \n",
    "        Sensor<Pressure> sensor2 = sensorNetwork1.addPressureSensor(\"P_1\");\n",
    "\n",
    "        // Add initial measurements to the sensors\n",
    "        sensor1.addMeasurement(Instant.now(), Quantities.getQuantity(25, Units.CELSIUS))\n",
    "                .addMeasurement(Instant.now().plusSeconds(15), Quantities.getQuantity(300.15, Units.KELVIN));\n",
    "\n",
    "        sensor2.addMeasurement(Instant.now(), Quantities.getQuantity(1013.25, Units.PASCAL));\n",
    "\n",
    "        // Create a function-based measure generator for temperature\n",
    "        FunctionBasedMeasureGenerator<Temperature> temperatureGenerator = FunctionBasedMeasureGenerator.<Temperature>builder()\n",
    "                .function(\n",
    "                        new Function() {\n",
    "                            @Override\n",
    "                            public double apply(long x) {\n",
    "                                // Simple linear function: temperature increases by 1 degree per second\n",
    "                                return 20 + 1 * x;\n",
    "                            }\n",
    "                        })\n",
    "                .startTime(Instant.now())\n",
    "                .endTime(Instant.now().plusSeconds(10))\n",
    "                .timeStep(Duration.of(1, java.time.temporal.ChronoUnit.SECONDS))\n",
    "                .variance(2)\n",
    "                .outlierProbability(0.1)\n",
    "                .build();\n",
    "\n",
    "        // Generate measurements for the temperature sensor\n",
    "        temperatureGenerator.generate(sensor1, Units.CELSIUS);\n",
    "\n",
    "        // Log the sensor network details\n",
    "        log.info(\"{}\", sensorNetwork1);\n",
    "\n",
    "        // Iterate over the sensors in the network\n",
    "        Iterator<Sensor> sensorIterator = sensorNetwork1.sensorIterator();\n",
    "        while (sensorIterator.hasNext()) {\n",
    "            Sensor sensor = sensorIterator.next();\n",
    "            log.info(\"{}\", sensor);\n",
    "\n",
    "            // Iterate over the measurements of each sensor\n",
    "            Iterator<Measurement> measurementIterator = sensor.measurementIterator();\n",
    "            while (measurementIterator.hasNext()) {\n",
    "                Measurement measurement = measurementIterator.next();\n",
    "                log.info(\"{}\", measurement);\n",
    "            }\n",
    "        }\n",
    "\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "6529fc89",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" contentStyleType=\"text/css\" height=\"737px\" preserveAspectRatio=\"none\" style=\"width:2160px;height:737px;background:#FFFFFF;\" version=\"1.1\" viewBox=\"0 0 2160 737\" width=\"2160px\" zoomAndPan=\"magnify\"><defs/><g><!--cluster fr--><g id=\"cluster_fr\"><path d=\"M8.5,6.7041 L26.3027,6.7041 A3.75,3.75 0 0 1 28.8027,9.2041 L35.8027,28.5635 L2150.5,28.5635 A2.5,2.5 0 0 1 2153,31.0635 L2153,728.2041 A2.5,2.5 0 0 1 2150.5,730.7041 L8.5,730.7041 A2.5,2.5 0 0 1 6,728.2041 L6,9.2041 A2.5,2.5 0 0 1 8.5,6.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"6\" x2=\"35.8027\" y1=\"28.5635\" y2=\"28.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"16.8027\" x=\"10\" y=\"20.3594\">fr</text></g><!--cluster univtln--><g id=\"cluster_univtln\"><path d=\"M32.5,48.7041 L92.3096,48.7041 A3.75,3.75 0 0 1 94.8096,51.2041 L101.8096,70.5635 L2126.5,70.5635 A2.5,2.5 0 0 1 2129,73.0635 L2129,704.2041 A2.5,2.5 0 0 1 2126.5,706.7041 L32.5,706.7041 A2.5,2.5 0 0 1 30,704.2041 L30,51.2041 A2.5,2.5 0 0 1 32.5,48.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"30\" x2=\"101.8096\" y1=\"70.5635\" y2=\"70.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"34\" y=\"62.3594\">univtln</text></g><!--cluster bruno--><g id=\"cluster_bruno\"><path d=\"M56.5,90.7041 L99.5068,90.7041 A3.75,3.75 0 0 1 102.0068,93.2041 L109.0068,112.5635 L2102.5,112.5635 A2.5,2.5 0 0 1 2105,115.0635 L2105,680.2041 A2.5,2.5 0 0 1 2102.5,682.7041 L56.5,682.7041 A2.5,2.5 0 0 1 54,680.2041 L54,93.2041 A2.5,2.5 0 0 1 56.5,90.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"54\" x2=\"109.0068\" y1=\"112.5635\" y2=\"112.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"42.0068\" x=\"58\" y=\"104.3594\">bruno</text></g><!--cluster samples--><g id=\"cluster_samples\"><path d=\"M80.5,132.7041 L140.3096,132.7041 A3.75,3.75 0 0 1 142.8096,135.2041 L149.8096,154.5635 L2078.5,154.5635 A2.5,2.5 0 0 1 2081,157.0635 L2081,656.2041 A2.5,2.5 0 0 1 2078.5,658.7041 L80.5,658.7041 A2.5,2.5 0 0 1 78,656.2041 L78,135.2041 A2.5,2.5 0 0 1 80.5,132.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"78\" x2=\"149.8096\" y1=\"154.5635\" y2=\"154.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"82\" y=\"146.3594\">samples</text></g><!--cluster data--><g id=\"cluster_data\"><path d=\"M1595.5,174.7041 L1630.1055,174.7041 A3.75,3.75 0 0 1 1632.6055,177.2041 L1639.6055,196.5635 L2054.5,196.5635 A2.5,2.5 0 0 1 2057,199.0635 L2057,576.7041 A2.5,2.5 0 0 1 2054.5,579.2041 L1595.5,579.2041 A2.5,2.5 0 0 1 1593,576.7041 L1593,177.2041 A2.5,2.5 0 0 1 1595.5,174.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"1593\" x2=\"1639.6055\" y1=\"196.5635\" y2=\"196.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"33.6055\" x=\"1597\" y=\"188.3594\">data</text></g><!--cluster sensors--><g id=\"cluster_sensors\"><path d=\"M104.5,409.7041 L164.3096,409.7041 A3.75,3.75 0 0 1 166.8096,412.2041 L173.8096,431.5635 L1566.5,431.5635 A2.5,2.5 0 0 1 1569,434.0635 L1569,632.2041 A2.5,2.5 0 0 1 1566.5,634.7041 L104.5,634.7041 A2.5,2.5 0 0 1 102,632.2041 L102,412.2041 A2.5,2.5 0 0 1 104.5,409.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"102\" x2=\"173.8096\" y1=\"431.5635\" y2=\"431.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"106\" y=\"423.3594\">sensors</text></g><!--class App--><g id=\"elem_App\"><rect codeLine=\"3\" fill=\"#F1F1F1\" height=\"63.8594\" id=\"App\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"185.626\" x=\"332\" y=\"264.2041\"/><ellipse cx=\"407.9609\" cy=\"280.2041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M405.8672,280.0479 Q405.8672,281.9229 406.4453,282.9385 Q407.0234,283.9385 408.1797,283.9385 Q409.5234,283.9385 410.1797,281.9229 L412.4453,282.3447 Q411.3359,285.876 408.1641,285.876 Q405.8203,285.876 404.6016,284.3916 Q403.3828,282.9072 403.3828,280.0479 Q403.3828,274.3291 408.0859,274.3291 Q409.6328,274.3291 410.6641,275.1416 Q411.7109,275.9541 412.2109,277.5635 L409.9453,278.1104 Q409.7109,277.2354 409.2266,276.751 Q408.7422,276.251 408.1172,276.251 Q405.8672,276.251 405.8672,280.0479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"25.2041\" x=\"428.4609\" y=\"283.9297\">App</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"333\" x2=\"516.626\" y1=\"296.2041\" y2=\"296.2041\"/><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"333\" x2=\"516.626\" y1=\"304.2041\" y2=\"304.2041\"/><ellipse cx=\"343\" cy=\"317.6338\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"159.626\" x=\"352\" y=\"319.8594\">main(String[] args)</text></g><!--class Function--><g id=\"elem_Function\"><rect codeLine=\"9\" fill=\"#F1F1F1\" height=\"63.8594\" id=\"Function\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"202.4287\" x=\"1724\" y=\"499.2041\"/><ellipse cx=\"1787.3589\" cy=\"515.2041\" fill=\"#B4A7E5\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M1783.6558,509.501 L1791.2651,509.501 L1791.2651,511.3916 L1788.687,511.3916 L1788.687,518.8135 L1791.2651,518.8135 L1791.2651,520.7041 L1783.6558,520.7041 L1783.6558,518.8135 L1786.2495,518.8135 L1786.2495,511.3916 L1783.6558,511.3916 L1783.6558,509.501 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-style=\"italic\" lengthAdjust=\"spacing\" textLength=\"67.2109\" x=\"1807.8589\" y=\"518.9297\">Function</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1725\" x2=\"1925.4287\" y1=\"531.2041\" y2=\"531.2041\"/><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1725\" x2=\"1925.4287\" y1=\"539.2041\" y2=\"539.2041\"/><ellipse cx=\"1735\" cy=\"552.6338\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"176.4287\" x=\"1744\" y=\"554.8594\">apply(long x): double</text></g><!--class FunctionBasedMeasureGenerator--><g id=\"elem_FunctionBasedMeasureGenerator\"><rect codeLine=\"13\" fill=\"#F1F1F1\" height=\"174.875\" id=\"FunctionBasedMeasureGenerator\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"430.8643\" x=\"1609.5\" y=\"208.7041\"/><ellipse cx=\"1624.5\" cy=\"224.7041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M1622.4063,224.5479 Q1622.4063,226.4229 1622.9844,227.4385 Q1623.5625,228.4385 1624.7188,228.4385 Q1626.0625,228.4385 1626.7188,226.4229 L1628.9844,226.8447 Q1627.875,230.376 1624.7031,230.376 Q1622.3594,230.376 1621.1406,228.8916 Q1619.9219,227.4072 1619.9219,224.5479 Q1619.9219,218.8291 1624.625,218.8291 Q1626.1719,218.8291 1627.2031,219.6416 Q1628.25,220.4541 1628.75,222.0635 L1626.4844,222.6104 Q1626.25,221.7354 1625.7656,221.251 Q1625.2813,220.751 1624.6563,220.751 Q1622.4063,220.751 1622.4063,224.5479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"243.6396\" x=\"1638.5\" y=\"228.4297\">FunctionBasedMeasureGenerator</text><rect fill=\"#FFFFFF\" height=\"15.5938\" style=\"stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;\" width=\"153.2246\" x=\"1890.1396\" y=\"205.7041\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" font-style=\"italic\" lengthAdjust=\"spacing\" textLength=\"151.2246\" x=\"1891.1396\" y=\"216.6943\">Q extends Quantity&lt;Q&gt;</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1610.5\" x2=\"2039.3643\" y1=\"240.7041\" y2=\"240.7041\"/><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"251.1338\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"142.8232\" x=\"1629.5\" y=\"256.3594\">Function function</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"266.9932\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"142.8232\" x=\"1629.5\" y=\"272.2188\">Instant startTime</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"282.8525\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"126.0205\" x=\"1629.5\" y=\"288.0781\">Instant endTime</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"298.7119\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"142.8232\" x=\"1629.5\" y=\"303.9375\">Duration timeStep</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"314.5713\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"126.0205\" x=\"1629.5\" y=\"319.7969\">double variance</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"330.4307\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"210.0342\" x=\"1629.5\" y=\"335.6563\">double outlierProbability</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"346.29\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"201.6328\" x=\"1629.5\" y=\"351.5156\">Duration currentDuration</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1610.5\" x2=\"2039.3643\" y1=\"359.7197\" y2=\"359.7197\"/><ellipse cx=\"1620.5\" cy=\"373.1494\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"336.0547\" x=\"1629.5\" y=\"375.375\">generate(Sensor&lt;Q&gt; sensor, Unit&lt;Q&gt; unit)</text></g><!--class Sensor--><g id=\"elem_Sensor\"><rect codeLine=\"26\" fill=\"#F1F1F1\" height=\"111.4375\" id=\"Sensor\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"471.2725\" x=\"766.5\" y=\"475.7041\"/><ellipse cx=\"895.0698\" cy=\"491.7041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M892.9761,491.5479 Q892.9761,493.4229 893.5542,494.4385 Q894.1323,495.4385 895.2886,495.4385 Q896.6323,495.4385 897.2886,493.4229 L899.5542,493.8447 Q898.4448,497.376 895.2729,497.376 Q892.9292,497.376 891.7104,495.8916 Q890.4917,494.4072 890.4917,491.5479 Q890.4917,485.8291 895.1948,485.8291 Q896.7417,485.8291 897.7729,486.6416 Q898.8198,487.4541 899.3198,489.0635 L897.0542,489.6104 Q896.8198,488.7354 896.3354,488.251 Q895.8511,487.751 895.2261,487.751 Q892.9761,487.751 892.9761,491.5479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"50.4082\" x=\"915.5698\" y=\"495.4297\">Sensor</text><rect fill=\"#FFFFFF\" height=\"15.5938\" style=\"stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;\" width=\"153.2246\" x=\"1087.5479\" y=\"472.7041\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" font-style=\"italic\" lengthAdjust=\"spacing\" textLength=\"151.2246\" x=\"1088.5479\" y=\"483.6943\">Q extends Quantity&lt;Q&gt;</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"767.5\" x2=\"1236.7725\" y1=\"507.7041\" y2=\"507.7041\"/><ellipse cx=\"777.5\" cy=\"521.1338\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"786.5\" y=\"523.3594\">UUID id</text><ellipse cx=\"777.5\" cy=\"536.9932\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"92.415\" x=\"786.5\" y=\"539.2188\">String name</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"767.5\" x2=\"1236.7725\" y1=\"547.4229\" y2=\"547.4229\"/><ellipse cx=\"777.5\" cy=\"560.8525\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"445.2725\" x=\"786.5\" y=\"563.0781\">addMeasurement(Instant timestamp, Q value): Sensor&lt;Q&gt;</text><ellipse cx=\"777.5\" cy=\"576.7119\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"394.8643\" x=\"786.5\" y=\"578.9375\">measurementIterator(): Iterator&lt;Measurement&lt;Q&gt;&gt;</text></g><!--class SensorNetwork--><g id=\"elem_SensorNetwork\"><rect codeLine=\"33\" fill=\"#F1F1F1\" height=\"174.875\" id=\"SensorNetwork\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"614.0957\" x=\"118\" y=\"443.7041\"/><ellipse cx=\"366.189\" cy=\"459.7041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M364.0952,459.5479 Q364.0952,461.4229 364.6733,462.4385 Q365.2515,463.4385 366.4077,463.4385 Q367.7515,463.4385 368.4077,461.4229 L370.6733,461.8447 Q369.564,465.376 366.3921,465.376 Q364.0483,465.376 362.8296,463.8916 Q361.6108,462.4072 361.6108,459.5479 Q361.6108,453.8291 366.314,453.8291 Q367.8608,453.8291 368.8921,454.6416 Q369.939,455.4541 370.439,457.0635 L368.1733,457.6104 Q367.939,456.7354 367.4546,456.251 Q366.9702,455.751 366.3452,455.751 Q364.0952,455.751 364.0952,459.5479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"109.2178\" x=\"386.689\" y=\"463.4297\">SensorNetwork</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"119\" x2=\"731.0957\" y1=\"475.7041\" y2=\"475.7041\"/><ellipse cx=\"129\" cy=\"489.1338\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"138\" y=\"491.3594\">UUID id</text><ellipse cx=\"129\" cy=\"504.9932\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"92.415\" x=\"138\" y=\"507.2188\">String name</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"119\" x2=\"731.0957\" y1=\"515.4229\" y2=\"515.4229\"/><ellipse cx=\"129\" cy=\"528.8525\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"588.0957\" x=\"138\" y=\"531.0781\">addTemperatureSensor(String sensorName): Sensor&lt;Quantity&lt;Temperature&gt;&gt;</text><ellipse cx=\"129\" cy=\"544.7119\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"537.6875\" x=\"138\" y=\"546.9375\">addPressureSensor(String sensorName): Sensor&lt;Quantity&lt;Pressure&gt;&gt;</text><ellipse cx=\"129\" cy=\"560.5713\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"218.4355\" x=\"138\" y=\"562.7969\">getSensor(UUID id): Sensor</text><ellipse cx=\"129\" cy=\"576.4307\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"226.8369\" x=\"138\" y=\"578.6563\">removeSensor(Sensor sensor)</text><ellipse cx=\"129\" cy=\"592.29\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"176.4287\" x=\"138\" y=\"594.5156\">removeSensor(UUID id)</text><ellipse cx=\"129\" cy=\"608.1494\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"285.6465\" x=\"138\" y=\"610.375\">sensorIterator(): Iterator&lt;Sensor&gt;</text></g><!--class Measurement--><g id=\"elem_Measurement\"><rect codeLine=\"44\" fill=\"#F1F1F1\" height=\"79.7188\" id=\"Measurement\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"279.6396\" x=\"1273\" y=\"491.2041\"/><ellipse cx=\"1288\" cy=\"507.2041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M1285.9063,507.0479 Q1285.9063,508.9229 1286.4844,509.9385 Q1287.0625,510.9385 1288.2188,510.9385 Q1289.5625,510.9385 1290.2188,508.9229 L1292.4844,509.3447 Q1291.375,512.876 1288.2031,512.876 Q1285.8594,512.876 1284.6406,511.3916 Q1283.4219,509.9072 1283.4219,507.0479 Q1283.4219,501.3291 1288.125,501.3291 Q1289.6719,501.3291 1290.7031,502.1416 Q1291.75,502.9541 1292.25,504.5635 L1289.9844,505.1104 Q1289.75,504.2354 1289.2656,503.751 Q1288.7813,503.251 1288.1563,503.251 Q1285.9063,503.251 1285.9063,507.0479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"92.415\" x=\"1302\" y=\"510.9297\">Measurement</text><rect fill=\"#FFFFFF\" height=\"15.5938\" style=\"stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;\" width=\"153.2246\" x=\"1402.415\" y=\"488.2041\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" font-style=\"italic\" lengthAdjust=\"spacing\" textLength=\"151.2246\" x=\"1403.415\" y=\"499.1943\">Q extends Quantity&lt;Q&gt;</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1274\" x2=\"1551.6396\" y1=\"523.2041\" y2=\"523.2041\"/><ellipse cx=\"1284\" cy=\"536.6338\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"142.8232\" x=\"1293\" y=\"538.8594\">Instant timestamp</text><ellipse cx=\"1284\" cy=\"552.4932\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"1293\" y=\"554.7188\">Q value</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1274\" x2=\"1551.6396\" y1=\"562.9229\" y2=\"562.9229\"/></g><!--link App to SensorNetwork--><g id=\"link_App_SensorNetwork\"><path codeLine=\"51\" d=\"M425,328.6241 C425,358.0641 425,397.4441 425,437.6941 \" fill=\"none\" id=\"App-to-SensorNetwork\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"425,443.6941,429,434.6941,425,438.6941,421,434.6941,425,443.6941\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--link FunctionBasedMeasureGenerator to Function--><g id=\"link_FunctionBasedMeasureGenerator_Function\"><path codeLine=\"52\" d=\"M1825,383.9641 C1825,424.3341 1825,463.8041 1825,493.1741 \" fill=\"none\" id=\"FunctionBasedMeasureGenerator-to-Function\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"1825,499.1741,1829,490.1741,1825,494.1741,1821,490.1741,1825,499.1741\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--link FunctionBasedMeasureGenerator to Sensor--><g id=\"link_FunctionBasedMeasureGenerator_Sensor\"><path codeLine=\"53\" d=\"M1609.3,382.9741 C1608.2,383.2241 1607.1,383.4641 1606,383.7041 C1453.78,416.7441 1406.53,361.6841 1256,401.7041 C1196.66,417.4841 1140.2893,445.2195 1092.6293,472.6695 \" fill=\"none\" id=\"FunctionBasedMeasureGenerator-to-Sensor\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"1087.43,475.6641,1097.2253,474.6385,1091.7627,473.1686,1093.2326,467.7061,1087.43,475.6641\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--link SensorNetwork to Sensor--><g id=\"link_SensorNetwork_Sensor\"><path codeLine=\"54\" d=\"M744.09,531.2041 C755.52,531.2041 748.94,531.2041 760.36,531.2041 \" fill=\"none\" id=\"SensorNetwork-Sensor\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"732.09,531.2041,738.09,535.2041,744.09,531.2041,738.09,527.2041,732.09,531.2041\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"766.36,531.2041,757.36,527.2041,761.36,531.2041,757.36,535.2041,766.36,531.2041\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--link Sensor to Measurement--><g id=\"link_Sensor_Measurement\"><path codeLine=\"55\" d=\"M1249.6,531.2041 C1261.36,531.2041 1255.13,531.2041 1266.89,531.2041 \" fill=\"none\" id=\"Sensor-Measurement\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"1237.6,531.2041,1243.6,535.2041,1249.6,531.2041,1243.6,527.2041,1237.6,531.2041\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"1272.89,531.2041,1263.89,527.2041,1267.89,531.2041,1263.89,535.2041,1272.89,531.2041\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--SRC=[dLJ1Rjim3BtxAtHqbYOVC0G6DXGRScZH8Crfs86n6KEeB0aIbRKO-k-JBIcMbxHPPnYs99BlaO-qDTHFq28xcAMJ_4X2BlV6IRMqq6c1blqkcBzg0TQoBrh7VN_DE-2ot9BXiltnau5fxMmmlXQlHQ6l02yR88XeN1AQ0zJ8lZbP4rSofm6jnKifb6pPy-mpQvJR2un4MN8fz2jOREuGh3Fu7IKQ86LM6uRFXBAnRED04gUNrQQgCfh5YVeG5wDfBItv8EQVXXvvX-Sc3pqrt3fFtCEHFzuIwj4KAc17C1naZMS6vKXmD0z6xM7FXS_r0cpjZ459QJ_ArOQQiToYj7tb5RF3weRj9AT-xnj27sbLY9_EGaA_fkjyjrlVCjwC1s5Yc8HChZaqgMUThwfCilRY-LMdRzZ62oOS-Wau5PQDuXYxfj3oqdkczIh3xlCxdvw0UO_qIvcd_qh_4JlTitcQ01O_ZQZ-lVVFSazYPL5LDS5xC6Zjny1II8xK8aM4MCafRlJnmgZZYMXuHQBP6qu9QpG7_ulYXvWBea-wSdMGpcPYDCNPI0p-xdzLYqKrxMlnxZzYy4yU_-0QLPnEpgU_3SD9LcZn1m00]--></g></svg>"
      ],
      "text/plain": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" contentStyleType=\"text/css\" height=\"737px\" preserveAspectRatio=\"none\" style=\"width:2160px;height:737px;background:#FFFFFF;\" version=\"1.1\" viewBox=\"0 0 2160 737\" width=\"2160px\" zoomAndPan=\"magnify\"><defs/><g><!--cluster fr--><g id=\"cluster_fr\"><path d=\"M8.5,6.7041 L26.3027,6.7041 A3.75,3.75 0 0 1 28.8027,9.2041 L35.8027,28.5635 L2150.5,28.5635 A2.5,2.5 0 0 1 2153,31.0635 L2153,728.2041 A2.5,2.5 0 0 1 2150.5,730.7041 L8.5,730.7041 A2.5,2.5 0 0 1 6,728.2041 L6,9.2041 A2.5,2.5 0 0 1 8.5,6.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"6\" x2=\"35.8027\" y1=\"28.5635\" y2=\"28.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"16.8027\" x=\"10\" y=\"20.3594\">fr</text></g><!--cluster univtln--><g id=\"cluster_univtln\"><path d=\"M32.5,48.7041 L92.3096,48.7041 A3.75,3.75 0 0 1 94.8096,51.2041 L101.8096,70.5635 L2126.5,70.5635 A2.5,2.5 0 0 1 2129,73.0635 L2129,704.2041 A2.5,2.5 0 0 1 2126.5,706.7041 L32.5,706.7041 A2.5,2.5 0 0 1 30,704.2041 L30,51.2041 A2.5,2.5 0 0 1 32.5,48.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"30\" x2=\"101.8096\" y1=\"70.5635\" y2=\"70.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"34\" y=\"62.3594\">univtln</text></g><!--cluster bruno--><g id=\"cluster_bruno\"><path d=\"M56.5,90.7041 L99.5068,90.7041 A3.75,3.75 0 0 1 102.0068,93.2041 L109.0068,112.5635 L2102.5,112.5635 A2.5,2.5 0 0 1 2105,115.0635 L2105,680.2041 A2.5,2.5 0 0 1 2102.5,682.7041 L56.5,682.7041 A2.5,2.5 0 0 1 54,680.2041 L54,93.2041 A2.5,2.5 0 0 1 56.5,90.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"54\" x2=\"109.0068\" y1=\"112.5635\" y2=\"112.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"42.0068\" x=\"58\" y=\"104.3594\">bruno</text></g><!--cluster samples--><g id=\"cluster_samples\"><path d=\"M80.5,132.7041 L140.3096,132.7041 A3.75,3.75 0 0 1 142.8096,135.2041 L149.8096,154.5635 L2078.5,154.5635 A2.5,2.5 0 0 1 2081,157.0635 L2081,656.2041 A2.5,2.5 0 0 1 2078.5,658.7041 L80.5,658.7041 A2.5,2.5 0 0 1 78,656.2041 L78,135.2041 A2.5,2.5 0 0 1 80.5,132.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"78\" x2=\"149.8096\" y1=\"154.5635\" y2=\"154.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"82\" y=\"146.3594\">samples</text></g><!--cluster data--><g id=\"cluster_data\"><path d=\"M1595.5,174.7041 L1630.1055,174.7041 A3.75,3.75 0 0 1 1632.6055,177.2041 L1639.6055,196.5635 L2054.5,196.5635 A2.5,2.5 0 0 1 2057,199.0635 L2057,576.7041 A2.5,2.5 0 0 1 2054.5,579.2041 L1595.5,579.2041 A2.5,2.5 0 0 1 1593,576.7041 L1593,177.2041 A2.5,2.5 0 0 1 1595.5,174.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"1593\" x2=\"1639.6055\" y1=\"196.5635\" y2=\"196.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"33.6055\" x=\"1597\" y=\"188.3594\">data</text></g><!--cluster sensors--><g id=\"cluster_sensors\"><path d=\"M104.5,409.7041 L164.3096,409.7041 A3.75,3.75 0 0 1 166.8096,412.2041 L173.8096,431.5635 L1566.5,431.5635 A2.5,2.5 0 0 1 1569,434.0635 L1569,632.2041 A2.5,2.5 0 0 1 1566.5,634.7041 L104.5,634.7041 A2.5,2.5 0 0 1 102,632.2041 L102,412.2041 A2.5,2.5 0 0 1 104.5,409.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"102\" x2=\"173.8096\" y1=\"431.5635\" y2=\"431.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"106\" y=\"423.3594\">sensors</text></g><!--class App--><g id=\"elem_App\"><rect codeLine=\"3\" fill=\"#F1F1F1\" height=\"63.8594\" id=\"App\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"185.626\" x=\"332\" y=\"264.2041\"/><ellipse cx=\"407.9609\" cy=\"280.2041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M405.8672,280.0479 Q405.8672,281.9229 406.4453,282.9385 Q407.0234,283.9385 408.1797,283.9385 Q409.5234,283.9385 410.1797,281.9229 L412.4453,282.3447 Q411.3359,285.876 408.1641,285.876 Q405.8203,285.876 404.6016,284.3916 Q403.3828,282.9072 403.3828,280.0479 Q403.3828,274.3291 408.0859,274.3291 Q409.6328,274.3291 410.6641,275.1416 Q411.7109,275.9541 412.2109,277.5635 L409.9453,278.1104 Q409.7109,277.2354 409.2266,276.751 Q408.7422,276.251 408.1172,276.251 Q405.8672,276.251 405.8672,280.0479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"25.2041\" x=\"428.4609\" y=\"283.9297\">App</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"333\" x2=\"516.626\" y1=\"296.2041\" y2=\"296.2041\"/><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"333\" x2=\"516.626\" y1=\"304.2041\" y2=\"304.2041\"/><ellipse cx=\"343\" cy=\"317.6338\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"159.626\" x=\"352\" y=\"319.8594\">main(String[] args)</text></g><!--class Function--><g id=\"elem_Function\"><rect codeLine=\"9\" fill=\"#F1F1F1\" height=\"63.8594\" id=\"Function\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"202.4287\" x=\"1724\" y=\"499.2041\"/><ellipse cx=\"1787.3589\" cy=\"515.2041\" fill=\"#B4A7E5\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M1783.6558,509.501 L1791.2651,509.501 L1791.2651,511.3916 L1788.687,511.3916 L1788.687,518.8135 L1791.2651,518.8135 L1791.2651,520.7041 L1783.6558,520.7041 L1783.6558,518.8135 L1786.2495,518.8135 L1786.2495,511.3916 L1783.6558,511.3916 L1783.6558,509.501 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-style=\"italic\" lengthAdjust=\"spacing\" textLength=\"67.2109\" x=\"1807.8589\" y=\"518.9297\">Function</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1725\" x2=\"1925.4287\" y1=\"531.2041\" y2=\"531.2041\"/><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1725\" x2=\"1925.4287\" y1=\"539.2041\" y2=\"539.2041\"/><ellipse cx=\"1735\" cy=\"552.6338\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"176.4287\" x=\"1744\" y=\"554.8594\">apply(long x): double</text></g><!--class FunctionBasedMeasureGenerator--><g id=\"elem_FunctionBasedMeasureGenerator\"><rect codeLine=\"13\" fill=\"#F1F1F1\" height=\"174.875\" id=\"FunctionBasedMeasureGenerator\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"430.8643\" x=\"1609.5\" y=\"208.7041\"/><ellipse cx=\"1624.5\" cy=\"224.7041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M1622.4063,224.5479 Q1622.4063,226.4229 1622.9844,227.4385 Q1623.5625,228.4385 1624.7188,228.4385 Q1626.0625,228.4385 1626.7188,226.4229 L1628.9844,226.8447 Q1627.875,230.376 1624.7031,230.376 Q1622.3594,230.376 1621.1406,228.8916 Q1619.9219,227.4072 1619.9219,224.5479 Q1619.9219,218.8291 1624.625,218.8291 Q1626.1719,218.8291 1627.2031,219.6416 Q1628.25,220.4541 1628.75,222.0635 L1626.4844,222.6104 Q1626.25,221.7354 1625.7656,221.251 Q1625.2813,220.751 1624.6563,220.751 Q1622.4063,220.751 1622.4063,224.5479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"243.6396\" x=\"1638.5\" y=\"228.4297\">FunctionBasedMeasureGenerator</text><rect fill=\"#FFFFFF\" height=\"15.5938\" style=\"stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;\" width=\"153.2246\" x=\"1890.1396\" y=\"205.7041\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" font-style=\"italic\" lengthAdjust=\"spacing\" textLength=\"151.2246\" x=\"1891.1396\" y=\"216.6943\">Q extends Quantity&lt;Q&gt;</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1610.5\" x2=\"2039.3643\" y1=\"240.7041\" y2=\"240.7041\"/><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"251.1338\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"142.8232\" x=\"1629.5\" y=\"256.3594\">Function function</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"266.9932\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"142.8232\" x=\"1629.5\" y=\"272.2188\">Instant startTime</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"282.8525\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"126.0205\" x=\"1629.5\" y=\"288.0781\">Instant endTime</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"298.7119\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"142.8232\" x=\"1629.5\" y=\"303.9375\">Duration timeStep</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"314.5713\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"126.0205\" x=\"1629.5\" y=\"319.7969\">double variance</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"330.4307\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"210.0342\" x=\"1629.5\" y=\"335.6563\">double outlierProbability</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"346.29\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"201.6328\" x=\"1629.5\" y=\"351.5156\">Duration currentDuration</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1610.5\" x2=\"2039.3643\" y1=\"359.7197\" y2=\"359.7197\"/><ellipse cx=\"1620.5\" cy=\"373.1494\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"336.0547\" x=\"1629.5\" y=\"375.375\">generate(Sensor&lt;Q&gt; sensor, Unit&lt;Q&gt; unit)</text></g><!--class Sensor--><g id=\"elem_Sensor\"><rect codeLine=\"26\" fill=\"#F1F1F1\" height=\"111.4375\" id=\"Sensor\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"471.2725\" x=\"766.5\" y=\"475.7041\"/><ellipse cx=\"895.0698\" cy=\"491.7041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M892.9761,491.5479 Q892.9761,493.4229 893.5542,494.4385 Q894.1323,495.4385 895.2886,495.4385 Q896.6323,495.4385 897.2886,493.4229 L899.5542,493.8447 Q898.4448,497.376 895.2729,497.376 Q892.9292,497.376 891.7104,495.8916 Q890.4917,494.4072 890.4917,491.5479 Q890.4917,485.8291 895.1948,485.8291 Q896.7417,485.8291 897.7729,486.6416 Q898.8198,487.4541 899.3198,489.0635 L897.0542,489.6104 Q896.8198,488.7354 896.3354,488.251 Q895.8511,487.751 895.2261,487.751 Q892.9761,487.751 892.9761,491.5479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"50.4082\" x=\"915.5698\" y=\"495.4297\">Sensor</text><rect fill=\"#FFFFFF\" height=\"15.5938\" style=\"stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;\" width=\"153.2246\" x=\"1087.5479\" y=\"472.7041\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" font-style=\"italic\" lengthAdjust=\"spacing\" textLength=\"151.2246\" x=\"1088.5479\" y=\"483.6943\">Q extends Quantity&lt;Q&gt;</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"767.5\" x2=\"1236.7725\" y1=\"507.7041\" y2=\"507.7041\"/><ellipse cx=\"777.5\" cy=\"521.1338\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"786.5\" y=\"523.3594\">UUID id</text><ellipse cx=\"777.5\" cy=\"536.9932\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"92.415\" x=\"786.5\" y=\"539.2188\">String name</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"767.5\" x2=\"1236.7725\" y1=\"547.4229\" y2=\"547.4229\"/><ellipse cx=\"777.5\" cy=\"560.8525\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"445.2725\" x=\"786.5\" y=\"563.0781\">addMeasurement(Instant timestamp, Q value): Sensor&lt;Q&gt;</text><ellipse cx=\"777.5\" cy=\"576.7119\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"394.8643\" x=\"786.5\" y=\"578.9375\">measurementIterator(): Iterator&lt;Measurement&lt;Q&gt;&gt;</text></g><!--class SensorNetwork--><g id=\"elem_SensorNetwork\"><rect codeLine=\"33\" fill=\"#F1F1F1\" height=\"174.875\" id=\"SensorNetwork\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"614.0957\" x=\"118\" y=\"443.7041\"/><ellipse cx=\"366.189\" cy=\"459.7041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M364.0952,459.5479 Q364.0952,461.4229 364.6733,462.4385 Q365.2515,463.4385 366.4077,463.4385 Q367.7515,463.4385 368.4077,461.4229 L370.6733,461.8447 Q369.564,465.376 366.3921,465.376 Q364.0483,465.376 362.8296,463.8916 Q361.6108,462.4072 361.6108,459.5479 Q361.6108,453.8291 366.314,453.8291 Q367.8608,453.8291 368.8921,454.6416 Q369.939,455.4541 370.439,457.0635 L368.1733,457.6104 Q367.939,456.7354 367.4546,456.251 Q366.9702,455.751 366.3452,455.751 Q364.0952,455.751 364.0952,459.5479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"109.2178\" x=\"386.689\" y=\"463.4297\">SensorNetwork</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"119\" x2=\"731.0957\" y1=\"475.7041\" y2=\"475.7041\"/><ellipse cx=\"129\" cy=\"489.1338\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"138\" y=\"491.3594\">UUID id</text><ellipse cx=\"129\" cy=\"504.9932\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"92.415\" x=\"138\" y=\"507.2188\">String name</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"119\" x2=\"731.0957\" y1=\"515.4229\" y2=\"515.4229\"/><ellipse cx=\"129\" cy=\"528.8525\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"588.0957\" x=\"138\" y=\"531.0781\">addTemperatureSensor(String sensorName): Sensor&lt;Quantity&lt;Temperature&gt;&gt;</text><ellipse cx=\"129\" cy=\"544.7119\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"537.6875\" x=\"138\" y=\"546.9375\">addPressureSensor(String sensorName): Sensor&lt;Quantity&lt;Pressure&gt;&gt;</text><ellipse cx=\"129\" cy=\"560.5713\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"218.4355\" x=\"138\" y=\"562.7969\">getSensor(UUID id): Sensor</text><ellipse cx=\"129\" cy=\"576.4307\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"226.8369\" x=\"138\" y=\"578.6563\">removeSensor(Sensor sensor)</text><ellipse cx=\"129\" cy=\"592.29\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"176.4287\" x=\"138\" y=\"594.5156\">removeSensor(UUID id)</text><ellipse cx=\"129\" cy=\"608.1494\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"285.6465\" x=\"138\" y=\"610.375\">sensorIterator(): Iterator&lt;Sensor&gt;</text></g><!--class Measurement--><g id=\"elem_Measurement\"><rect codeLine=\"44\" fill=\"#F1F1F1\" height=\"79.7188\" id=\"Measurement\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"279.6396\" x=\"1273\" y=\"491.2041\"/><ellipse cx=\"1288\" cy=\"507.2041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M1285.9063,507.0479 Q1285.9063,508.9229 1286.4844,509.9385 Q1287.0625,510.9385 1288.2188,510.9385 Q1289.5625,510.9385 1290.2188,508.9229 L1292.4844,509.3447 Q1291.375,512.876 1288.2031,512.876 Q1285.8594,512.876 1284.6406,511.3916 Q1283.4219,509.9072 1283.4219,507.0479 Q1283.4219,501.3291 1288.125,501.3291 Q1289.6719,501.3291 1290.7031,502.1416 Q1291.75,502.9541 1292.25,504.5635 L1289.9844,505.1104 Q1289.75,504.2354 1289.2656,503.751 Q1288.7813,503.251 1288.1563,503.251 Q1285.9063,503.251 1285.9063,507.0479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"92.415\" x=\"1302\" y=\"510.9297\">Measurement</text><rect fill=\"#FFFFFF\" height=\"15.5938\" style=\"stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;\" width=\"153.2246\" x=\"1402.415\" y=\"488.2041\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" font-style=\"italic\" lengthAdjust=\"spacing\" textLength=\"151.2246\" x=\"1403.415\" y=\"499.1943\">Q extends Quantity&lt;Q&gt;</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1274\" x2=\"1551.6396\" y1=\"523.2041\" y2=\"523.2041\"/><ellipse cx=\"1284\" cy=\"536.6338\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"142.8232\" x=\"1293\" y=\"538.8594\">Instant timestamp</text><ellipse cx=\"1284\" cy=\"552.4932\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"1293\" y=\"554.7188\">Q value</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1274\" x2=\"1551.6396\" y1=\"562.9229\" y2=\"562.9229\"/></g><!--link App to SensorNetwork--><g id=\"link_App_SensorNetwork\"><path codeLine=\"51\" d=\"M425,328.6241 C425,358.0641 425,397.4441 425,437.6941 \" fill=\"none\" id=\"App-to-SensorNetwork\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"425,443.6941,429,434.6941,425,438.6941,421,434.6941,425,443.6941\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--link FunctionBasedMeasureGenerator to Function--><g id=\"link_FunctionBasedMeasureGenerator_Function\"><path codeLine=\"52\" d=\"M1825,383.9641 C1825,424.3341 1825,463.8041 1825,493.1741 \" fill=\"none\" id=\"FunctionBasedMeasureGenerator-to-Function\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"1825,499.1741,1829,490.1741,1825,494.1741,1821,490.1741,1825,499.1741\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--link FunctionBasedMeasureGenerator to Sensor--><g id=\"link_FunctionBasedMeasureGenerator_Sensor\"><path codeLine=\"53\" d=\"M1609.3,382.9741 C1608.2,383.2241 1607.1,383.4641 1606,383.7041 C1453.78,416.7441 1406.53,361.6841 1256,401.7041 C1196.66,417.4841 1140.2893,445.2195 1092.6293,472.6695 \" fill=\"none\" id=\"FunctionBasedMeasureGenerator-to-Sensor\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"1087.43,475.6641,1097.2253,474.6385,1091.7627,473.1686,1093.2326,467.7061,1087.43,475.6641\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--link SensorNetwork to Sensor--><g id=\"link_SensorNetwork_Sensor\"><path codeLine=\"54\" d=\"M744.09,531.2041 C755.52,531.2041 748.94,531.2041 760.36,531.2041 \" fill=\"none\" id=\"SensorNetwork-Sensor\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"732.09,531.2041,738.09,535.2041,744.09,531.2041,738.09,527.2041,732.09,531.2041\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"766.36,531.2041,757.36,527.2041,761.36,531.2041,757.36,535.2041,766.36,531.2041\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--link Sensor to Measurement--><g id=\"link_Sensor_Measurement\"><path codeLine=\"55\" d=\"M1249.6,531.2041 C1261.36,531.2041 1255.13,531.2041 1266.89,531.2041 \" fill=\"none\" id=\"Sensor-Measurement\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"1237.6,531.2041,1243.6,535.2041,1249.6,531.2041,1243.6,527.2041,1237.6,531.2041\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"1272.89,531.2041,1263.89,527.2041,1267.89,531.2041,1263.89,535.2041,1272.89,531.2041\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--SRC=[dLJ1Rjim3BtxAtHqbYOVC0G6DXGRScZH8Crfs86n6KEeB0aIbRKO-k-JBIcMbxHPPnYs99BlaO-qDTHFq28xcAMJ_4X2BlV6IRMqq6c1blqkcBzg0TQoBrh7VN_DE-2ot9BXiltnau5fxMmmlXQlHQ6l02yR88XeN1AQ0zJ8lZbP4rSofm6jnKifb6pPy-mpQvJR2un4MN8fz2jOREuGh3Fu7IKQ86LM6uRFXBAnRED04gUNrQQgCfh5YVeG5wDfBItv8EQVXXvvX-Sc3pqrt3fFtCEHFzuIwj4KAc17C1naZMS6vKXmD0z6xM7FXS_r0cpjZ459QJ_ArOQQiToYj7tb5RF3weRj9AT-xnj27sbLY9_EGaA_fkjyjrlVCjwC1s5Yc8HChZaqgMUThwfCilRY-LMdRzZ62oOS-Wau5PQDuXYxfj3oqdkczIh3xlCxdvw0UO_qIvcd_qh_4JlTitcQ01O_ZQZ-lVVFSazYPL5LDS5xC6Zjny1II8xK8aM4MCafRlJnmgZZYMXuHQBP6qu9QpG7_ulYXvWBea-wSdMGpcPYDCNPI0p-xdzLYqKrxMlnxZzYy4yU_-0QLPnEpgU_3SD9LcZn1m00]--></g></svg>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" contentStyleType=\"text/css\" height=\"737px\" preserveAspectRatio=\"none\" style=\"width:2160px;height:737px;background:#FFFFFF;\" version=\"1.1\" viewBox=\"0 0 2160 737\" width=\"2160px\" zoomAndPan=\"magnify\"><defs/><g><!--cluster fr--><g id=\"cluster_fr\"><path d=\"M8.5,6.7041 L26.3027,6.7041 A3.75,3.75 0 0 1 28.8027,9.2041 L35.8027,28.5635 L2150.5,28.5635 A2.5,2.5 0 0 1 2153,31.0635 L2153,728.2041 A2.5,2.5 0 0 1 2150.5,730.7041 L8.5,730.7041 A2.5,2.5 0 0 1 6,728.2041 L6,9.2041 A2.5,2.5 0 0 1 8.5,6.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"6\" x2=\"35.8027\" y1=\"28.5635\" y2=\"28.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"16.8027\" x=\"10\" y=\"20.3594\">fr</text></g><!--cluster univtln--><g id=\"cluster_univtln\"><path d=\"M32.5,48.7041 L92.3096,48.7041 A3.75,3.75 0 0 1 94.8096,51.2041 L101.8096,70.5635 L2126.5,70.5635 A2.5,2.5 0 0 1 2129,73.0635 L2129,704.2041 A2.5,2.5 0 0 1 2126.5,706.7041 L32.5,706.7041 A2.5,2.5 0 0 1 30,704.2041 L30,51.2041 A2.5,2.5 0 0 1 32.5,48.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"30\" x2=\"101.8096\" y1=\"70.5635\" y2=\"70.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"34\" y=\"62.3594\">univtln</text></g><!--cluster bruno--><g id=\"cluster_bruno\"><path d=\"M56.5,90.7041 L99.5068,90.7041 A3.75,3.75 0 0 1 102.0068,93.2041 L109.0068,112.5635 L2102.5,112.5635 A2.5,2.5 0 0 1 2105,115.0635 L2105,680.2041 A2.5,2.5 0 0 1 2102.5,682.7041 L56.5,682.7041 A2.5,2.5 0 0 1 54,680.2041 L54,93.2041 A2.5,2.5 0 0 1 56.5,90.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"54\" x2=\"109.0068\" y1=\"112.5635\" y2=\"112.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"42.0068\" x=\"58\" y=\"104.3594\">bruno</text></g><!--cluster samples--><g id=\"cluster_samples\"><path d=\"M80.5,132.7041 L140.3096,132.7041 A3.75,3.75 0 0 1 142.8096,135.2041 L149.8096,154.5635 L2078.5,154.5635 A2.5,2.5 0 0 1 2081,157.0635 L2081,656.2041 A2.5,2.5 0 0 1 2078.5,658.7041 L80.5,658.7041 A2.5,2.5 0 0 1 78,656.2041 L78,135.2041 A2.5,2.5 0 0 1 80.5,132.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"78\" x2=\"149.8096\" y1=\"154.5635\" y2=\"154.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"82\" y=\"146.3594\">samples</text></g><!--cluster data--><g id=\"cluster_data\"><path d=\"M1595.5,174.7041 L1630.1055,174.7041 A3.75,3.75 0 0 1 1632.6055,177.2041 L1639.6055,196.5635 L2054.5,196.5635 A2.5,2.5 0 0 1 2057,199.0635 L2057,576.7041 A2.5,2.5 0 0 1 2054.5,579.2041 L1595.5,579.2041 A2.5,2.5 0 0 1 1593,576.7041 L1593,177.2041 A2.5,2.5 0 0 1 1595.5,174.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"1593\" x2=\"1639.6055\" y1=\"196.5635\" y2=\"196.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"33.6055\" x=\"1597\" y=\"188.3594\">data</text></g><!--cluster sensors--><g id=\"cluster_sensors\"><path d=\"M104.5,409.7041 L164.3096,409.7041 A3.75,3.75 0 0 1 166.8096,412.2041 L173.8096,431.5635 L1566.5,431.5635 A2.5,2.5 0 0 1 1569,434.0635 L1569,632.2041 A2.5,2.5 0 0 1 1566.5,634.7041 L104.5,634.7041 A2.5,2.5 0 0 1 102,632.2041 L102,412.2041 A2.5,2.5 0 0 1 104.5,409.7041 \" fill=\"none\" style=\"stroke:#000000;stroke-width:1.5;\"/><line style=\"stroke:#000000;stroke-width:1.5;\" x1=\"102\" x2=\"173.8096\" y1=\"431.5635\" y2=\"431.5635\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-weight=\"bold\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"106\" y=\"423.3594\">sensors</text></g><!--class App--><g id=\"elem_App\"><rect codeLine=\"3\" fill=\"#F1F1F1\" height=\"63.8594\" id=\"App\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"185.626\" x=\"332\" y=\"264.2041\"/><ellipse cx=\"407.9609\" cy=\"280.2041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M405.8672,280.0479 Q405.8672,281.9229 406.4453,282.9385 Q407.0234,283.9385 408.1797,283.9385 Q409.5234,283.9385 410.1797,281.9229 L412.4453,282.3447 Q411.3359,285.876 408.1641,285.876 Q405.8203,285.876 404.6016,284.3916 Q403.3828,282.9072 403.3828,280.0479 Q403.3828,274.3291 408.0859,274.3291 Q409.6328,274.3291 410.6641,275.1416 Q411.7109,275.9541 412.2109,277.5635 L409.9453,278.1104 Q409.7109,277.2354 409.2266,276.751 Q408.7422,276.251 408.1172,276.251 Q405.8672,276.251 405.8672,280.0479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"25.2041\" x=\"428.4609\" y=\"283.9297\">App</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"333\" x2=\"516.626\" y1=\"296.2041\" y2=\"296.2041\"/><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"333\" x2=\"516.626\" y1=\"304.2041\" y2=\"304.2041\"/><ellipse cx=\"343\" cy=\"317.6338\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"159.626\" x=\"352\" y=\"319.8594\">main(String[] args)</text></g><!--class Function--><g id=\"elem_Function\"><rect codeLine=\"9\" fill=\"#F1F1F1\" height=\"63.8594\" id=\"Function\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"202.4287\" x=\"1724\" y=\"499.2041\"/><ellipse cx=\"1787.3589\" cy=\"515.2041\" fill=\"#B4A7E5\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M1783.6558,509.501 L1791.2651,509.501 L1791.2651,511.3916 L1788.687,511.3916 L1788.687,518.8135 L1791.2651,518.8135 L1791.2651,520.7041 L1783.6558,520.7041 L1783.6558,518.8135 L1786.2495,518.8135 L1786.2495,511.3916 L1783.6558,511.3916 L1783.6558,509.501 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" font-style=\"italic\" lengthAdjust=\"spacing\" textLength=\"67.2109\" x=\"1807.8589\" y=\"518.9297\">Function</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1725\" x2=\"1925.4287\" y1=\"531.2041\" y2=\"531.2041\"/><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1725\" x2=\"1925.4287\" y1=\"539.2041\" y2=\"539.2041\"/><ellipse cx=\"1735\" cy=\"552.6338\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"176.4287\" x=\"1744\" y=\"554.8594\">apply(long x): double</text></g><!--class FunctionBasedMeasureGenerator--><g id=\"elem_FunctionBasedMeasureGenerator\"><rect codeLine=\"13\" fill=\"#F1F1F1\" height=\"174.875\" id=\"FunctionBasedMeasureGenerator\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"430.8643\" x=\"1609.5\" y=\"208.7041\"/><ellipse cx=\"1624.5\" cy=\"224.7041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M1622.4063,224.5479 Q1622.4063,226.4229 1622.9844,227.4385 Q1623.5625,228.4385 1624.7188,228.4385 Q1626.0625,228.4385 1626.7188,226.4229 L1628.9844,226.8447 Q1627.875,230.376 1624.7031,230.376 Q1622.3594,230.376 1621.1406,228.8916 Q1619.9219,227.4072 1619.9219,224.5479 Q1619.9219,218.8291 1624.625,218.8291 Q1626.1719,218.8291 1627.2031,219.6416 Q1628.25,220.4541 1628.75,222.0635 L1626.4844,222.6104 Q1626.25,221.7354 1625.7656,221.251 Q1625.2813,220.751 1624.6563,220.751 Q1622.4063,220.751 1622.4063,224.5479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"243.6396\" x=\"1638.5\" y=\"228.4297\">FunctionBasedMeasureGenerator</text><rect fill=\"#FFFFFF\" height=\"15.5938\" style=\"stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;\" width=\"153.2246\" x=\"1890.1396\" y=\"205.7041\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" font-style=\"italic\" lengthAdjust=\"spacing\" textLength=\"151.2246\" x=\"1891.1396\" y=\"216.6943\">Q extends Quantity&lt;Q&gt;</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1610.5\" x2=\"2039.3643\" y1=\"240.7041\" y2=\"240.7041\"/><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"251.1338\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"142.8232\" x=\"1629.5\" y=\"256.3594\">Function function</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"266.9932\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"142.8232\" x=\"1629.5\" y=\"272.2188\">Instant startTime</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"282.8525\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"126.0205\" x=\"1629.5\" y=\"288.0781\">Instant endTime</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"298.7119\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"142.8232\" x=\"1629.5\" y=\"303.9375\">Duration timeStep</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"314.5713\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"126.0205\" x=\"1629.5\" y=\"319.7969\">double variance</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"330.4307\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"210.0342\" x=\"1629.5\" y=\"335.6563\">double outlierProbability</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"1617.5\" y=\"346.29\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"201.6328\" x=\"1629.5\" y=\"351.5156\">Duration currentDuration</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1610.5\" x2=\"2039.3643\" y1=\"359.7197\" y2=\"359.7197\"/><ellipse cx=\"1620.5\" cy=\"373.1494\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"336.0547\" x=\"1629.5\" y=\"375.375\">generate(Sensor&lt;Q&gt; sensor, Unit&lt;Q&gt; unit)</text></g><!--class Sensor--><g id=\"elem_Sensor\"><rect codeLine=\"26\" fill=\"#F1F1F1\" height=\"111.4375\" id=\"Sensor\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"471.2725\" x=\"766.5\" y=\"475.7041\"/><ellipse cx=\"895.0698\" cy=\"491.7041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M892.9761,491.5479 Q892.9761,493.4229 893.5542,494.4385 Q894.1323,495.4385 895.2886,495.4385 Q896.6323,495.4385 897.2886,493.4229 L899.5542,493.8447 Q898.4448,497.376 895.2729,497.376 Q892.9292,497.376 891.7104,495.8916 Q890.4917,494.4072 890.4917,491.5479 Q890.4917,485.8291 895.1948,485.8291 Q896.7417,485.8291 897.7729,486.6416 Q898.8198,487.4541 899.3198,489.0635 L897.0542,489.6104 Q896.8198,488.7354 896.3354,488.251 Q895.8511,487.751 895.2261,487.751 Q892.9761,487.751 892.9761,491.5479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"50.4082\" x=\"915.5698\" y=\"495.4297\">Sensor</text><rect fill=\"#FFFFFF\" height=\"15.5938\" style=\"stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;\" width=\"153.2246\" x=\"1087.5479\" y=\"472.7041\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" font-style=\"italic\" lengthAdjust=\"spacing\" textLength=\"151.2246\" x=\"1088.5479\" y=\"483.6943\">Q extends Quantity&lt;Q&gt;</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"767.5\" x2=\"1236.7725\" y1=\"507.7041\" y2=\"507.7041\"/><ellipse cx=\"777.5\" cy=\"521.1338\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"786.5\" y=\"523.3594\">UUID id</text><ellipse cx=\"777.5\" cy=\"536.9932\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"92.415\" x=\"786.5\" y=\"539.2188\">String name</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"767.5\" x2=\"1236.7725\" y1=\"547.4229\" y2=\"547.4229\"/><ellipse cx=\"777.5\" cy=\"560.8525\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"445.2725\" x=\"786.5\" y=\"563.0781\">addMeasurement(Instant timestamp, Q value): Sensor&lt;Q&gt;</text><ellipse cx=\"777.5\" cy=\"576.7119\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"394.8643\" x=\"786.5\" y=\"578.9375\">measurementIterator(): Iterator&lt;Measurement&lt;Q&gt;&gt;</text></g><!--class SensorNetwork--><g id=\"elem_SensorNetwork\"><rect codeLine=\"33\" fill=\"#F1F1F1\" height=\"174.875\" id=\"SensorNetwork\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"614.0957\" x=\"118\" y=\"443.7041\"/><ellipse cx=\"366.189\" cy=\"459.7041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M364.0952,459.5479 Q364.0952,461.4229 364.6733,462.4385 Q365.2515,463.4385 366.4077,463.4385 Q367.7515,463.4385 368.4077,461.4229 L370.6733,461.8447 Q369.564,465.376 366.3921,465.376 Q364.0483,465.376 362.8296,463.8916 Q361.6108,462.4072 361.6108,459.5479 Q361.6108,453.8291 366.314,453.8291 Q367.8608,453.8291 368.8921,454.6416 Q369.939,455.4541 370.439,457.0635 L368.1733,457.6104 Q367.939,456.7354 367.4546,456.251 Q366.9702,455.751 366.3452,455.751 Q364.0952,455.751 364.0952,459.5479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"109.2178\" x=\"386.689\" y=\"463.4297\">SensorNetwork</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"119\" x2=\"731.0957\" y1=\"475.7041\" y2=\"475.7041\"/><ellipse cx=\"129\" cy=\"489.1338\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"138\" y=\"491.3594\">UUID id</text><ellipse cx=\"129\" cy=\"504.9932\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"92.415\" x=\"138\" y=\"507.2188\">String name</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"119\" x2=\"731.0957\" y1=\"515.4229\" y2=\"515.4229\"/><ellipse cx=\"129\" cy=\"528.8525\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"588.0957\" x=\"138\" y=\"531.0781\">addTemperatureSensor(String sensorName): Sensor&lt;Quantity&lt;Temperature&gt;&gt;</text><ellipse cx=\"129\" cy=\"544.7119\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"537.6875\" x=\"138\" y=\"546.9375\">addPressureSensor(String sensorName): Sensor&lt;Quantity&lt;Pressure&gt;&gt;</text><ellipse cx=\"129\" cy=\"560.5713\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"218.4355\" x=\"138\" y=\"562.7969\">getSensor(UUID id): Sensor</text><ellipse cx=\"129\" cy=\"576.4307\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"226.8369\" x=\"138\" y=\"578.6563\">removeSensor(Sensor sensor)</text><ellipse cx=\"129\" cy=\"592.29\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"176.4287\" x=\"138\" y=\"594.5156\">removeSensor(UUID id)</text><ellipse cx=\"129\" cy=\"608.1494\" fill=\"#84BE84\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"285.6465\" x=\"138\" y=\"610.375\">sensorIterator(): Iterator&lt;Sensor&gt;</text></g><!--class Measurement--><g id=\"elem_Measurement\"><rect codeLine=\"44\" fill=\"#F1F1F1\" height=\"79.7188\" id=\"Measurement\" rx=\"2.5\" ry=\"2.5\" style=\"stroke:#181818;stroke-width:0.5;\" width=\"279.6396\" x=\"1273\" y=\"491.2041\"/><ellipse cx=\"1288\" cy=\"507.2041\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#181818;stroke-width:1.0;\"/><path d=\"M1285.9063,507.0479 Q1285.9063,508.9229 1286.4844,509.9385 Q1287.0625,510.9385 1288.2188,510.9385 Q1289.5625,510.9385 1290.2188,508.9229 L1292.4844,509.3447 Q1291.375,512.876 1288.2031,512.876 Q1285.8594,512.876 1284.6406,511.3916 Q1283.4219,509.9072 1283.4219,507.0479 Q1283.4219,501.3291 1288.125,501.3291 Q1289.6719,501.3291 1290.7031,502.1416 Q1291.75,502.9541 1292.25,504.5635 L1289.9844,505.1104 Q1289.75,504.2354 1289.2656,503.751 Q1288.7813,503.251 1288.1563,503.251 Q1285.9063,503.251 1285.9063,507.0479 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"92.415\" x=\"1302\" y=\"510.9297\">Measurement</text><rect fill=\"#FFFFFF\" height=\"15.5938\" style=\"stroke:#181818;stroke-width:1.0;stroke-dasharray:2.0,2.0;\" width=\"153.2246\" x=\"1402.415\" y=\"488.2041\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" font-style=\"italic\" lengthAdjust=\"spacing\" textLength=\"151.2246\" x=\"1403.415\" y=\"499.1943\">Q extends Quantity&lt;Q&gt;</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1274\" x2=\"1551.6396\" y1=\"523.2041\" y2=\"523.2041\"/><ellipse cx=\"1284\" cy=\"536.6338\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"142.8232\" x=\"1293\" y=\"538.8594\">Instant timestamp</text><ellipse cx=\"1284\" cy=\"552.4932\" fill=\"none\" rx=\"3\" ry=\"3\" style=\"stroke:#038048;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"14\" lengthAdjust=\"spacing\" textLength=\"58.8096\" x=\"1293\" y=\"554.7188\">Q value</text><line style=\"stroke:#181818;stroke-width:0.5;\" x1=\"1274\" x2=\"1551.6396\" y1=\"562.9229\" y2=\"562.9229\"/></g><!--link App to SensorNetwork--><g id=\"link_App_SensorNetwork\"><path codeLine=\"51\" d=\"M425,328.6241 C425,358.0641 425,397.4441 425,437.6941 \" fill=\"none\" id=\"App-to-SensorNetwork\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"425,443.6941,429,434.6941,425,438.6941,421,434.6941,425,443.6941\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--link FunctionBasedMeasureGenerator to Function--><g id=\"link_FunctionBasedMeasureGenerator_Function\"><path codeLine=\"52\" d=\"M1825,383.9641 C1825,424.3341 1825,463.8041 1825,493.1741 \" fill=\"none\" id=\"FunctionBasedMeasureGenerator-to-Function\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"1825,499.1741,1829,490.1741,1825,494.1741,1821,490.1741,1825,499.1741\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--link FunctionBasedMeasureGenerator to Sensor--><g id=\"link_FunctionBasedMeasureGenerator_Sensor\"><path codeLine=\"53\" d=\"M1609.3,382.9741 C1608.2,383.2241 1607.1,383.4641 1606,383.7041 C1453.78,416.7441 1406.53,361.6841 1256,401.7041 C1196.66,417.4841 1140.2893,445.2195 1092.6293,472.6695 \" fill=\"none\" id=\"FunctionBasedMeasureGenerator-to-Sensor\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"1087.43,475.6641,1097.2253,474.6385,1091.7627,473.1686,1093.2326,467.7061,1087.43,475.6641\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--link SensorNetwork to Sensor--><g id=\"link_SensorNetwork_Sensor\"><path codeLine=\"54\" d=\"M744.09,531.2041 C755.52,531.2041 748.94,531.2041 760.36,531.2041 \" fill=\"none\" id=\"SensorNetwork-Sensor\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"732.09,531.2041,738.09,535.2041,744.09,531.2041,738.09,527.2041,732.09,531.2041\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"766.36,531.2041,757.36,527.2041,761.36,531.2041,757.36,535.2041,766.36,531.2041\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--link Sensor to Measurement--><g id=\"link_Sensor_Measurement\"><path codeLine=\"55\" d=\"M1249.6,531.2041 C1261.36,531.2041 1255.13,531.2041 1266.89,531.2041 \" fill=\"none\" id=\"Sensor-Measurement\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"1237.6,531.2041,1243.6,535.2041,1249.6,531.2041,1243.6,527.2041,1237.6,531.2041\" style=\"stroke:#181818;stroke-width:1.0;\"/><polygon fill=\"#181818\" points=\"1272.89,531.2041,1263.89,527.2041,1267.89,531.2041,1263.89,535.2041,1272.89,531.2041\" style=\"stroke:#181818;stroke-width:1.0;\"/></g><!--SRC=[dLJ1Rjim3BtxAtHqbYOVC0G6DXGRScZH8Crfs86n6KEeB0aIbRKO-k-JBIcMbxHPPnYs99BlaO-qDTHFq28xcAMJ_4X2BlV6IRMqq6c1blqkcBzg0TQoBrh7VN_DE-2ot9BXiltnau5fxMmmlXQlHQ6l02yR88XeN1AQ0zJ8lZbP4rSofm6jnKifb6pPy-mpQvJR2un4MN8fz2jOREuGh3Fu7IKQ86LM6uRFXBAnRED04gUNrQQgCfh5YVeG5wDfBItv8EQVXXvvX-Sc3pqrt3fFtCEHFzuIwj4KAc17C1naZMS6vKXmD0z6xM7FXS_r0cpjZ459QJ_ArOQQiToYj7tb5RF3weRj9AT-xnj27sbLY9_EGaA_fkjyjrlVCjwC1s5Yc8HChZaqgMUThwfCilRY-LMdRzZ62oOS-Wau5PQDuXYxfj3oqdkczIh3xlCxdvw0UO_qIvcd_qh_4JlTitcQ01O_ZQZ-lVVFSazYPL5LDS5xC6Zjny1II8xK8aM4MCafRlJnmgZZYMXuHQBP6qu9QpG7_ulYXvWBea-wSdMGpcPYDCNPI0p-xdzLYqKrxMlnxZzYy4yU_-0QLPnEpgU_3SD9LcZn1m00]--></g></svg>"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "//| echo: false\n",
    "//| output: true\n",
    "String script=\"\"\"\n",
    "@startuml\n",
    "\n",
    "package fr.univtln.bruno.samples {\n",
    "    class App {\n",
    "        +main(String[] args)\n",
    "    }\n",
    "}\n",
    "\n",
    "package fr.univtln.bruno.samples.data {\n",
    "    interface Function {\n",
    "        +apply(long x): double\n",
    "    }\n",
    "\n",
    "    class FunctionBasedMeasureGenerator<Q extends Quantity<Q>> {\n",
    "        -Function function\n",
    "        -Instant startTime\n",
    "        -Instant endTime\n",
    "        -Duration timeStep\n",
    "        -double variance\n",
    "        -double outlierProbability\n",
    "        -Duration currentDuration\n",
    "        +generate(Sensor<Q> sensor, Unit<Q> unit)\n",
    "    }\n",
    "}\n",
    "\n",
    "package fr.univtln.bruno.samples.sensors {\n",
    "    class Sensor<Q extends Quantity<Q>> {\n",
    "        +UUID id\n",
    "        +String name\n",
    "        +addMeasurement(Instant timestamp, Q value): Sensor<Q>\n",
    "        +measurementIterator(): Iterator<Measurement<Q>>\n",
    "    }\n",
    "\n",
    "    class SensorNetwork {\n",
    "        +UUID id\n",
    "        +String name\n",
    "        +addTemperatureSensor(String sensorName): Sensor<Quantity<Temperature>>\n",
    "        +addPressureSensor(String sensorName): Sensor<Quantity<Pressure>>\n",
    "        +getSensor(UUID id): Sensor\n",
    "        +removeSensor(Sensor sensor)\n",
    "        +removeSensor(UUID id)\n",
    "        +sensorIterator(): Iterator<Sensor>\n",
    "    }\n",
    "\n",
    "    class Measurement<Q extends Quantity<Q>> {\n",
    "        +Instant timestamp\n",
    "        +Q value\n",
    "    }\n",
    "\n",
    "}\n",
    "\n",
    "App --> SensorNetwork\n",
    "FunctionBasedMeasureGenerator --> Function\n",
    "FunctionBasedMeasureGenerator --> Sensor\n",
    "SensorNetwork *-> Sensor\n",
    "Sensor *-> Measurement\n",
    "\n",
    "@enduml\n",
    "\"\"\";\n",
    "    \n",
    "IJava.getKernelInstance().getMagics().applyCellMagic(\"plantUML\",List.of(),script);  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0f8eb32b",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "java",
   "language": "java",
   "name": "java"
  },
  "language_info": {
   "codemirror_mode": "java",
   "file_extension": ".jshell",
   "mimetype": "text/x-java-source",
   "name": "java",
   "pygments_lexer": "java",
   "version": "21.0.5+11-LTS"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
