public static void main(String[] args) {
    
        NetworkEvent networkEvent;
        //inicia os nós
        init();
        //enquanto a lista de eventos não está vazia permanece no loop 
        while (!NetworkEventList.isEmpty()){                      
            networkEvent = NetworkEventList.get(NetworkEventList.size()-1);  // pega o próximo evento
            NetworkEventList.remove(NetworkEventList.size()-1); //remove primeiro elemento da lista

            if(networkEvent == null){
                break;
            }    
                        
            //faz o update dos eventos
            if (networkEvent.getEvtype() == FROM_LAYER2){
                if (networkEvent.getEventity() == 0){
                    node0.rtupdate0(networkEvent.getRtpkt());
                }else if(networkEvent.getEventity() == 1){
                    node1.rtupdate1(networkEvent.getRtpkt());
                }else if(networkEvent.getEventity() == 2){
                    node2.rtupdate2(networkEvent.getRtpkt());              
                }else if(networkEvent.getEventity() == 3){
                    node3.rtupdate3(networkEvent.getRtpkt());              
                }else{
                    System.out.print("Panic: unknown event entity");
                }
            }else{
                System.out.print("Panic: unknown event type");
            }           
            
        }
        System.out.println("\n\n-------------------------------------------------------------------------------------------------");
        System.out.print("Final Result: \n");
        node0.printDt0();
        node1.printDt1();
        node2.printDt2();
        node3.printDt3();        
        System.out.print("\nSimulator terminated, no packets in medium\n");
    }