public void parseData(String addr, int port, String data) {
        Message m = gson.fromJson(data, Message.class);
        String mType = m.getType();
        if (mType.equals(Message.REGISTER)) {
            graphManager.register(m.getId(), addr, port);
//            sendMessageToUI(m);
        } else if (mType.equals(Message.HEARTBEAT)) {
            graphManager.heartbeat(m.getId(), addr, port);
            sendMessageToUI(m);
        } else if (mType.equals(Message.INT_START)) {
            controller.startSim();
        } else if (mType.equals(Message.PROCESS_ONLINE)) {
            echoProcessOnline();
        } else if (mType.equals(Message.KILL)) {
            sendKillMessage();
            System.out.println("kill");
            System.exit(0);
        } else if (mType.equals(Message.TASK)) {
        } else if (mType.equals(Message.TASK_RESULT)) {
        }
    }