@Override
    public void run() {
        while (true) {
            Random rand = new Random();
            try {
                sleep(rand.nextInt(2000) + 1000);
            } catch (InterruptedException ex) {
                System.out.println("A error occured when the lemming was waiting before taking the next action");
                System.out.println(ex.getCause() + "\n" + ex.getMessage() + "\n" + ex.fillInStackTrace());
                ex.printStackTrace();
            }
            int randomAction = rand.nextInt(POSIBLE_ACTIONS.length);
            switch (POSIBLE_ACTIONS[randomAction]) {
                case GET_CHILD:
                    FieldConnector currentFieldConnector = new FieldConnector(currentField);
                    if (!currentFieldConnector.askForChild(this)) {
                        currentFieldConnector.closeConnection();
                        return;
                    }
                    currentFieldConnector.closeConnection();
                    break;
                case MOVE:
                    int randomField = rand.nextInt(fieldMap.getServerAddresses().size());
                    if (!fieldMap.getServerAddress(randomField).equals(currentField)) {
                        if (!move(fieldMap.getServerAddress(randomField))) {
                            return;
                        }
                    }
                    break;
                case SLEEP:
                    try {
                    sleep(rand.nextInt(10000));
                } catch (InterruptedException ex) {
                    System.out.println("A error occured when the lemming was sleeping");
                    System.out.println(ex.getCause() + "\n" + ex.getMessage() + "\n" + ex.fillInStackTrace());
                    ex.printStackTrace();
                }
                    break;
            }
        }
    }