private static void linkNetworkSCFQ(Router router, GridSimCore obj,
                double[] weight, int max_buf_size, int drop_alg, int min_th,
                int max_th, double max_p, double queue_weight, boolean stats)
                throws Exception
    {
        if (router == null)
        {
            System.out.println("Error - router is NULL !!");
            return;
        }

        // get the baud rate of a link
        double baud_rate = obj.getLink().getBaudRate();
        PacketScheduler pktObj;

        if (drop_alg == GridSimTags.FNB_ARED)
        {
            System.out.println("linkNetworkSCFQ(): creating ARED scheduler.");

            // create the packet scheduler for this link
            pktObj = new ARED(router.get_name() + "_to_" + obj.get_name(),
                              baud_rate, max_p, max_buf_size, queue_weight, stats);

            ((ARED) pktObj).setWeights(weight);
        }
        else if (drop_alg == GridSimTags.FNB_RED)
        {
            System.out.println("linkNetworkSCFQ(): creating RED scheduler.");

            // create the packet scheduler for this link
            pktObj = new RED(router.get_name() + "_to_" + obj.get_name(),
                             baud_rate, max_buf_size, min_th, max_th,
                             max_p, queue_weight, stats);

            ((RED) pktObj).setWeights(weight);
        }
        else // if (drop_alg == GridSimTags.FNB_FIFO)
        {

            System.out.println("linkNetworkSCFQ(): creating FIFO scheduler.");

            // create the packet scheduler for this link
            pktObj = new FIFO(router.get_name() + "_to_" + obj.get_name(),
                              baud_rate, max_buf_size, queue_weight, stats);

            // This is also needed here, as SCFQ is the scheduler for this link
            ((FIFO) pktObj).setWeights(weight);

        }

        // attach this GridSim entity to a Router
        router.attachHost(obj, pktObj);
    }