learn(from, to, callback, costPower = 0, costMultiplier = 1) {
        $.console.assert(costPower >= 0 && costPower <= 7, "[DataTypeConverter] Conversion costPower must be between <0, 7>.");
        $.console.assert($.isFunction(callback), "[DataTypeConverter:learn] Callback must be a valid function!");

        if (from === to) {
            this.copyings[to] = callback;
        } else {
            //we won't know if somebody added multiple edges, though it will choose some edge anyway
            costPower++;
            costMultiplier = Math.min(Math.max(costMultiplier, 1), 10 ^ 5);
            this.graph.addVertex(from);
            this.graph.addVertex(to);
            this.graph.addEdge(from, to, costPower * 10 ^ 5 + costMultiplier, callback);
            this._known = {}; //invalidate precomputed paths :/
        }
    }
Teach the system to convert data type 'from' -> 'to'
@param {string} from unique ID of the data item 'from'
@param {string} to unique ID of the data item 'to'
@param {OpenSeadragon.TypeConverter} callback converter that takes two arguments: a tile reference, and
 a data object of a type 'from'; and converts this data object to type 'to'. It can return also the value
 wrapped in a Promise (returned in resolve) or it can be async function.
@param {Number} [costPower=0] positive cost class of the conversion, smaller or equal than 7.
  Should reflect the actual cost of the conversion:
  - if nothing must be done and only reference is retrieved (or a constant operation done),
    return 0 (default)
  - if a linear amount of work is necessary,
    return 1
  ... and so on, basically the number in O() complexity power exponent (for simplification)
@param {Number} [costMultiplier=1] multiplier of the cost class, e.g. O(3n^2) would
  use costPower=2, costMultiplier=3; can be between 1 and 10^5