public int get(int forwardId, int backwardId) {int offset = (backwardId * forwardSize + forwardId) * 2;return buffer.getShort(offset);}
public int Get(int forwardId, int backwardId){return costs[backwardId][forwardId];}