Example - Detecting Leaks or Discontinuities

This Agent has two inputs and is designed to spot a sudden drop in value across a sequence.

In this case, we are looking for a difference between the value of a property between an asset and it's neighbour. We can do this with a spider attachment and a differential algorithm.

We want to set the min property of the differential algorithm to the minimum difference that we would consider 'a problem'.

In this case, let's go with 80kPa.

Code

{
   "name": "Leak",
   "style": "Differential",
   "normalise": "*",
   "data": {
		"min": ">80",
                "abs": "true"
   },
   "inputs": [ 
             { "name": "Target" }, 
             { "name": "Actual" }, 
   ],
   "outputs": [ {
		"name": "Status",
		"style": "boolean",
		"threshold": ">0.85"
	  }
	],
   "binding": {
		"Actual": "{-1}.Pressure - Air"
		"Target": "{0}.Pressure - Air"
	},
	"attachment": [ {
		"style": "spider",		
		"asset": "Air Compressor"
      }
	]
}