anchor.diff:    TKMGroupEval = record
       HitPoints, Attack, AttackHorse, Defence, DefenceProjectiles: Single;
     end;
  -
     TKMArmyEval = array[TKMGroupType] of TKMGroupEval;
     TKMGameEval = array[0 .. MAX_HANDS - 1] of TKMArmyEval;
   
  +  TKMGroupStrengthArray = array[TKMGroupType] of Single;
   
     //This class evaluate self army relatively enemy armies
     TKMArmyEvaluation = class
     private
       fEvals: TKMGameEval; //Results of evaluation
   
  -    procedure EvaluatePower(aPlayer: TKMHandIndex; aConsiderHitChance: Boolean = False);
  +    function CalculateStrength(aEval: TKMArmyEval): TKMGroupStrengthArray;
       function GetUnitEvaluation(aUT: TKMUnitType; aConsiderHitChance: Boolean = False): TKMGroupEval;
       function GetEvaluation(aPlayer: TKMHandIndex): TKMArmyEval;
       function GetAllianceStrength(aPlayer: TKMHandIndex; aAlliance: TKMAllianceType): TKMArmyEval;
  +    procedure EvaluatePower(aPlayer: TKMHandIndex; aConsiderHitChance: Boolean = False);
     public
       constructor Create();
       destructor Destroy; override;
  
positive.code:   PL: Integer;
    GT: TKMGroupType;
  begin
    for GT := Low(TKMGroupType) to High(TKMGroupType) do
      with Result[GT] do
      begin
        Hitpoints := 0;
        Attack := 0;
        AttackHorse := 0;
        Defence := 0;
        DefenceProjectiles := 0;
      end;
    for PL := 0 to gHands.Count - 1 do
      if gHands[PL].Enabled AND (gHands[aPlayer].Alliances[PL] = aAlliance) then
        for GT := Low(TKMGroupType) to High(TKMGroupType) do
          with Result[GT] do
          begin
            Hitpoints := Hitpoints                   + fEvals[PL,GT].Hitpoints;
            Attack := Attack                         + fEvals[PL,GT].Attack;
            AttackHorse := AttackHorse               + fEvals[PL,GT].AttackHorse;
            Defence := Defence                       + fEvals[PL,GT].Defence;
            DefenceProjectiles := DefenceProjectiles + fEvals[PL,GT].DefenceProjectiles;
          end;
  end;
  
  
  //function TKMArmyEvaluation.AttackForceChance(aOponent: TKMHandIndex; aGroups: TKMUnitGroupArray): Single;
  //var
  //
  //begin
  //  EnemyEval := Evaluation[aOponent];
  //end;
  
  
  // Approximate way how to compute strength of 2 alliances
  function TKMArmyEvaluation.CompareAllianceStrength(aPlayer, aOponent: TKMHandIndex): Single;
  type
    TKMGroupStrengthArray = array[TKMGroupType] of Single;
    function CalculateStrength(aEval: TKMArmyEval): TKMGroupStrengthArray;
    const
      DEF_COEFICIENT = 100; // Increase weight of defence
    var
      GT: TKMGroupType;
    begin
      for GT := Low(TKMGroupType) to High(TKMGroupType) do
        with aEval[GT] do
        begin
          Result[GT] := Attack * Hitpoints * Defence;
          //if (GT = gt_AntiHorse) then
          //  Resutl[GT] := Result[GT] * AttackHorse;
        end;
    end;
  var
    Sum, Diff: Single;
    GT: TKMGroupType;
  
negative.code: 
  function TKMArmyEvaluation.GetEvaluation(aPlayer: TKMHandIndex): TKMArmyEval;
  begin
    Move(fEvals[aPlayer], Result, SizeOf(fEvals[aPlayer]));
  end;
  
  
  function TKMArmyEvaluation.CalculateStrength(aEval: TKMArmyEval): TKMGroupStrengthArray;
    var
      GT: TKMGroupType;
    begin
      for GT := Low(TKMGroupType) to High(TKMGroupType) do
        with aEval[GT] do
          Result[GT] := Attack * Hitpoints * Defence;
          //Result[GT] := Attack * Max(1, AttackHorse) * Hitpoints * Defence;
    end;
  
  
  function TKMArmyEvaluation.CompareStrength(aPlayer, aOponent: TKMHandIndex): Single;
  var
    Sum, Diff: Single;
    GT: TKMGroupType;
    PlayerArmy, EnemyArmy: TKMGroupStrengthArray;
  begin
    PlayerArmy := CalculateStrength( Evaluation[aPlayer] );
    EnemyArmy := CalculateStrength( Evaluation[aOponent] );
    Sum := 0;
    Diff := 0;
    for GT := Low(TKMGroupType) to High(TKMGroupType) do
    begin
      Sum := Sum + PlayerArmy[GT] + EnemyArmy[GT];
      Diff := Diff + PlayerArmy[GT] - EnemyArmy[GT];
    end;
    Result := Diff / Max(1,Sum); // => number in <-1,1> ... positive = we have advantage and vice versa
  end;
  
  
  