public Link(long from_id, long to_id, int length, int lsiclass, int maxspeed) {
        this.from_id = from_id;
        this.to_id = to_id;
        this.length = length;
        int lsiSpeed = 0;
        try {
            lsiSpeed = LSISpeed.getSpeedById(lsiclass);
        } catch (Exception e) {
            System.out.println("LSIClass not in List: " + lsiclass);
            System.exit(1);
        }

        if (maxspeed != 0 && maxspeed < lsiSpeed) {
            this.speed = maxspeed;
        } else {
            this.speed = lsiSpeed;
        }

        this.time = (double) this.length / (double) (this.speed * 1000 / 60 / 60);
    }