public void attachHost(GridSimCore entity, PacketScheduler sched)
    {
        String msg = super.get_name() + ".attachHost(): Error - ";
        if (entity == null)
        {
            System.out.println(msg + "the entity is null.");
            return;
        }

        if (sched == null)
        {
            System.out.println(msg + "the packet scheduler is null.");
            return;
        }

        Link link = entity.getLink();
        sched.setBaudRate( link.getBaudRate() );
        sched.setRouterID( super.get_id()) ;
        link.attach(this, entity);
        linkTable_.put( entity.get_name(), link.get_name() );
        hostTable_.put( link.get_name(), entity.get_name() );

        if (!schedTable_.containsKey( link.get_name() )) {
            schedTable_.put(link.get_name(), sched);
        }

        // recording ...
        if (reportWriter_ != null)
        {
            StringBuffer sb = null;
            sb = new StringBuffer("attach this ROUTER, to entity, ");
            sb.append( entity.get_name() );
            sb.append(", with packet scheduler, ");
            sb.append( sched.getSchedName() );

            super.write( sb.toString() );
        }
    }