Details
Description
The code in MoveCoseFunction:
return scale(0, cluster.numRegions + META_MOVE_COST_MULT, moveCost);
It uses cluster.numRegions + META_MOVE_COST_MULT as the max value when scale moveCost to [0,1]. But this should use maxMoves as the max value when cluster have a lot of regions.
Assume a cluster have 10000 regions, maxMoves is 2500, it only scale moveCost to [0, 0.25].
Improve moveCost by use Math.min(cluster.numRegions, maxMoves) as the max cost, so it can scale moveCost to [0,1].
return scale(0, Math.min(cluster.numRegions, maxMoves) + META_MOVE_COST_MULT, moveCost);