public FwySegment(LpLink ml_link,LpLink or_link,LpLink fr_link, FundamentalDiagram fd, Actuator actuator){

        // link references
        ml_link_id = ml_link==null?null:ml_link.getId();
        or_link_id = or_link==null?null:or_link.getId();
        fr_link_id = fr_link==null?null:fr_link.getId();
        fr_node_id = fr_link==null?null: fr_link.getBegin().getId();
        ml_link_length = ml_link==null?null:ml_link.getLength();
        or_link_length =  or_link==null?null:or_link.getLength();
        or_lanes = or_link==null?null:or_link.getLanes();

        double ml_lanes = ml_link.getLanes();

        // fundamental diagram
        f_max = fd.getCapacity()*ml_lanes;
        vf = fd.getFreeFlowSpeed()/ml_link_length;
        w = fd.getCongestionSpeed()/ml_link_length;
        n_max = fd.getJamDensity()!=null ? fd.getJamDensity() : fd.getCapacity()*(1d/fd.getFreeFlowSpeed()+1d/fd.getCongestionSpeed());     // veh/meter/lane
        n_max *= ml_lanes;  // veh/meter
        n_max *= ml_link_length; // veh/link

        // metering
        is_metered = actuator!=null;
        has_on_ramp = or_link!=null;
        has_off_ramp = fr_link != null;

        if(is_metered){
            Parameters P = actuator.getParameters();
            r_max = get_parameter(P,"max_rate_in_vphpl",Double.POSITIVE_INFINITY)*or_lanes/3600d;
            l_max = get_parameter(P,"max_queue_length_in_veh",Double.POSITIVE_INFINITY);
        }
        else{
            r_max = Double.POSITIVE_INFINITY;
            l_max = Double.POSITIVE_INFINITY;
        }

        this.no = 0d;
        this.lo = 0d;

    }