import Classifier from '@cansat-icarus/capture-lib/src/icarus/classifier/index.js'
Classifier
Extends:
Calculates packet and station scores. Not an AI classifier. Packet scores are calculated based on the CRC checksum(60%) and simple heuristics(min/max value, variation between packets)(40%). The heuristics used are configured in the packet-heuristics.js map. Station scores are calculated based on the average packet score. The weight of each packet score is determined by the racional function 1/2x where x is a positive non-zero integer that represents how recent the packet is (1 being the most recent packet).
Constructor Summary
Public Constructor | ||
public |
constructor(logger: Bunyan) Constructor. |
Member Summary
Public Members | ||
public |
The station score. |
Private Members | ||
private |
The last data received (all packets merge in here). |
|
private |
_log: Bunyan Logger instance. |
Method Summary
Public Methods | ||
public |
classifyPacket(packet: Object, updateStationClassification: Boolean): Number Classifies one packet and updates the station score (unless told otherwise). |
|
public |
classifyStationInc(packetScore: Number): Number Updates the station score(incrementally). |
Public Constructors
public constructor(logger: Bunyan) source
Constructor.
Params:
Name | Type | Attribute | Description |
logger | Bunyan | Logger instance. |
Public Members
Private Members
Public Methods
public classifyPacket(packet: Object, updateStationClassification: Boolean): Number source
Classifies one packet and updates the station score (unless told otherwise). Packet scores are calculated based on the CRC checksum(60%) and simple heuristics(min/max value, variation between packets)(40%).
Emit:
* |
stationScore(stationScore): when updateStationClassification is true, the station score is updated and the event is fired. |
public classifyStationInc(packetScore: Number): Number source
Updates the station score(incrementally). Station scores are calculated based on the average packet score. The weight of each packet score is determined by the racional function 1/2x where x is a positive non-zero integer that represents how recent the packet is (1 being the most recent packet).
Params:
Name | Type | Attribute | Description |
packetScore | Number | The score of the previously unnacounted packet. |
Emit:
* |
stationScore(stationScore): because the station score was updated. |