public boolean calculateFlee()
    {
        boolean flee = false;
        Random rand;
        int playerLevel = origin.getLevel();
        int monsterLevel = 0;
        for(Character c: targets)
        {
            monsterLevel += c.getLevel();
        }
        double advantageLevel = (double) playerLevel / monsterLevel;
        int randomNumber;
        rand = new Random();  
      
        //Get Character agility level.
        int agility = origin.getAgility();
        advantageLevel += (agility * 0.2);
        if(advantageLevel == 1)
        {
            randomNumber = rand.nextInt(2) + 1;
            if(randomNumber == 1)
            {
                flee = true;
            }
            else
            {
                flee = false;
            }
        }
        
        else if(advantageLevel > 1)
        {
            flee = true;
        }
        else if(advantageLevel < 0.1)
        {
            flee = false;
        }
        else
        {
            double escapeChance = rand.nextDouble();
            flee = (escapeChance <= advantageLevel);
        }
        
        return flee;
    }