Custom Adaptive Data Rate Algorithm

How can I modify the ADR algorithm behaviour? I’d like to implement my own algorithm.

The code for ADR handling is located at https://github.com/brocaar/loraserver/blob/master/internal/adr/adr.go.