Exemple #1
0
 public void ConfigureEvaluation(Eval eval)
 {
     // Endgame Material
     eval.Config.EgPawnMaterial   = Parameters[nameof(EvalConfig.EgPawnMaterial)].Value;
     eval.Config.EgKnightMaterial = Parameters[nameof(EvalConfig.EgKnightMaterial)].Value;
     eval.Config.EgBishopMaterial = Parameters[nameof(EvalConfig.EgBishopMaterial)].Value;
     eval.Config.EgRookMaterial   = Parameters[nameof(EvalConfig.EgRookMaterial)].Value;
     eval.Config.EgQueenMaterial  = Parameters[nameof(EvalConfig.EgQueenMaterial)].Value;
     // Pawn Location
     eval.Config.MgPawnAdvancement = Parameters[nameof(EvalConfig.MgPawnAdvancement)].Value;
     eval.Config.EgPawnAdvancement = Parameters[nameof(EvalConfig.EgPawnAdvancement)].Value;
     eval.Config.MgPawnCentrality  = Parameters[nameof(EvalConfig.MgPawnCentrality)].Value;
     eval.Config.EgPawnCentrality  = Parameters[nameof(EvalConfig.EgPawnCentrality)].Value;
     // Knight Location
     eval.Config.MgKnightAdvancement = Parameters[nameof(EvalConfig.MgKnightAdvancement)].Value;
     eval.Config.EgKnightAdvancement = Parameters[nameof(EvalConfig.EgKnightAdvancement)].Value;
     eval.Config.MgKnightCentrality  = Parameters[nameof(EvalConfig.MgKnightCentrality)].Value;
     eval.Config.EgKnightCentrality  = Parameters[nameof(EvalConfig.EgKnightCentrality)].Value;
     eval.Config.MgKnightCorner      = Parameters[nameof(EvalConfig.MgKnightCorner)].Value;
     eval.Config.EgKnightCorner      = Parameters[nameof(EvalConfig.EgKnightCorner)].Value;
     // Bishop Location
     eval.Config.MgBishopAdvancement = Parameters[nameof(EvalConfig.MgBishopAdvancement)].Value;
     eval.Config.EgBishopAdvancement = Parameters[nameof(EvalConfig.EgBishopAdvancement)].Value;
     eval.Config.MgBishopCentrality  = Parameters[nameof(EvalConfig.MgBishopCentrality)].Value;
     eval.Config.EgBishopCentrality  = Parameters[nameof(EvalConfig.EgBishopCentrality)].Value;
     eval.Config.MgBishopCorner      = Parameters[nameof(EvalConfig.MgBishopCorner)].Value;
     eval.Config.EgBishopCorner      = Parameters[nameof(EvalConfig.EgBishopCorner)].Value;
     // Rook Location
     eval.Config.MgRookAdvancement = Parameters[nameof(EvalConfig.MgRookAdvancement)].Value;
     eval.Config.EgRookAdvancement = Parameters[nameof(EvalConfig.EgRookAdvancement)].Value;
     eval.Config.MgRookCentrality  = Parameters[nameof(EvalConfig.MgRookCentrality)].Value;
     eval.Config.EgRookCentrality  = Parameters[nameof(EvalConfig.EgRookCentrality)].Value;
     eval.Config.MgRookCorner      = Parameters[nameof(EvalConfig.MgRookCorner)].Value;
     eval.Config.EgRookCorner      = Parameters[nameof(EvalConfig.EgRookCorner)].Value;
     // Queen Location
     eval.Config.MgQueenAdvancement = Parameters[nameof(EvalConfig.MgQueenAdvancement)].Value;
     eval.Config.EgQueenAdvancement = Parameters[nameof(EvalConfig.EgQueenAdvancement)].Value;
     eval.Config.MgQueenCentrality  = Parameters[nameof(EvalConfig.MgQueenCentrality)].Value;
     eval.Config.EgQueenCentrality  = Parameters[nameof(EvalConfig.EgQueenCentrality)].Value;
     eval.Config.MgQueenCorner      = Parameters[nameof(EvalConfig.MgQueenCorner)].Value;
     eval.Config.EgQueenCorner      = Parameters[nameof(EvalConfig.EgQueenCorner)].Value;
     // King Location
     eval.Config.MgKingAdvancement = Parameters[nameof(EvalConfig.MgKingAdvancement)].Value;
     eval.Config.EgKingAdvancement = Parameters[nameof(EvalConfig.EgKingAdvancement)].Value;
     eval.Config.MgKingCentrality  = Parameters[nameof(EvalConfig.MgKingCentrality)].Value;
     eval.Config.EgKingCentrality  = Parameters[nameof(EvalConfig.EgKingCentrality)].Value;
     eval.Config.MgKingCorner      = Parameters[nameof(EvalConfig.MgKingCorner)].Value;
     eval.Config.EgKingCorner      = Parameters[nameof(EvalConfig.EgKingCorner)].Value;
     // Pawn Structure
     eval.Config.MgIsolatedPawn = Parameters[nameof(EvalConfig.MgIsolatedPawn)].Value;
     eval.Config.EgIsolatedPawn = Parameters[nameof(EvalConfig.EgIsolatedPawn)].Value;
     eval.Config.MgDoubledPawn  = Parameters[nameof(EvalConfig.MgDoubledPawn)].Value;
     eval.Config.EgDoubledPawn  = Parameters[nameof(EvalConfig.EgDoubledPawn)].Value;
     // Passed Pawns
     eval.Config.PassedPawnPowerPer128       = Parameters[nameof(EvalConfig.PassedPawnPowerPer128)].Value;
     eval.Config.MgPassedPawnScalePer128     = Parameters[nameof(EvalConfig.MgPassedPawnScalePer128)].Value;
     eval.Config.EgPassedPawnScalePer128     = Parameters[nameof(EvalConfig.EgPassedPawnScalePer128)].Value;
     eval.Config.EgFreePassedPawnScalePer128 = Parameters[nameof(EvalConfig.EgFreePassedPawnScalePer128)].Value;
     eval.Config.EgKingEscortedPassedPawn    = Parameters[nameof(EvalConfig.EgKingEscortedPassedPawn)].Value;
     // Piece Mobility
     eval.Config.PieceMobilityPowerPer128 = Parameters[nameof(EvalConfig.PieceMobilityPowerPer128)].Value;
     eval.Config.MgKnightMobilityScale    = Parameters[nameof(EvalConfig.MgKnightMobilityScale)].Value;
     eval.Config.EgKnightMobilityScale    = Parameters[nameof(EvalConfig.EgKnightMobilityScale)].Value;
     eval.Config.MgBishopMobilityScale    = Parameters[nameof(EvalConfig.MgBishopMobilityScale)].Value;
     eval.Config.EgBishopMobilityScale    = Parameters[nameof(EvalConfig.EgBishopMobilityScale)].Value;
     eval.Config.MgRookMobilityScale      = Parameters[nameof(EvalConfig.MgRookMobilityScale)].Value;
     eval.Config.EgRookMobilityScale      = Parameters[nameof(EvalConfig.EgRookMobilityScale)].Value;
     eval.Config.MgQueenMobilityScale     = Parameters[nameof(EvalConfig.MgQueenMobilityScale)].Value;
     eval.Config.EgQueenMobilityScale     = Parameters[nameof(EvalConfig.EgQueenMobilityScale)].Value;
     // King Safety
     eval.Config.MgKingSafetyPowerPer128 = Parameters[nameof(EvalConfig.MgKingSafetyPowerPer128)].Value;
     eval.Config.MgKingSafetyScalePer128 = Parameters[nameof(EvalConfig.MgKingSafetyScalePer128)].Value;
     eval.Config.MgKingSafetyMinorAttackOuterRingPer8 = Parameters[nameof(EvalConfig.MgKingSafetyMinorAttackOuterRingPer8)].Value;
     eval.Config.MgKingSafetyMinorAttackInnerRingPer8 = Parameters[nameof(EvalConfig.MgKingSafetyMinorAttackInnerRingPer8)].Value;
     eval.Config.MgKingSafetyRookAttackOuterRingPer8  = Parameters[nameof(EvalConfig.MgKingSafetyRookAttackOuterRingPer8)].Value;
     eval.Config.MgKingSafetyRookAttackInnerRingPer8  = Parameters[nameof(EvalConfig.MgKingSafetyRookAttackInnerRingPer8)].Value;
     eval.Config.MgKingSafetyQueenAttackOuterRingPer8 = Parameters[nameof(EvalConfig.MgKingSafetyQueenAttackOuterRingPer8)].Value;
     eval.Config.MgKingSafetyQueenAttackInnerRingPer8 = Parameters[nameof(EvalConfig.MgKingSafetyQueenAttackInnerRingPer8)].Value;
     eval.Config.MgKingSafetySemiOpenFilePer8         = Parameters[nameof(EvalConfig.MgKingSafetySemiOpenFilePer8)].Value;
     eval.Config.MgKingSafetyPawnShieldPer8           = Parameters[nameof(EvalConfig.MgKingSafetyPawnShieldPer8)].Value;
     // Threats
     eval.Config.MgPawnThreatenMinor  = Parameters[nameof(EvalConfig.MgPawnThreatenMinor)].Value;
     eval.Config.EgPawnThreatenMinor  = Parameters[nameof(EvalConfig.EgPawnThreatenMinor)].Value;
     eval.Config.MgPawnThreatenMajor  = Parameters[nameof(EvalConfig.MgPawnThreatenMajor)].Value;
     eval.Config.EgPawnThreatenMajor  = Parameters[nameof(EvalConfig.EgPawnThreatenMajor)].Value;
     eval.Config.MgMinorThreatenMajor = Parameters[nameof(EvalConfig.MgMinorThreatenMajor)].Value;
     eval.Config.EgMinorThreatenMajor = Parameters[nameof(EvalConfig.EgMinorThreatenMajor)].Value;
     // Minor Pieces
     eval.Config.MgBishopPair    = Parameters[nameof(EvalConfig.MgBishopPair)].Value;
     eval.Config.EgBishopPair    = Parameters[nameof(EvalConfig.EgBishopPair)].Value;
     eval.Config.MgKnightOutpost = Parameters[nameof(EvalConfig.MgKnightOutpost)].Value;
     eval.Config.EgKnightOutpost = Parameters[nameof(EvalConfig.EgKnightOutpost)].Value;
     eval.Config.MgBishopOutpost = Parameters[nameof(EvalConfig.MgBishopOutpost)].Value;
     eval.Config.EgBishopOutpost = Parameters[nameof(EvalConfig.EgBishopOutpost)].Value;
     // Endgame Scale
     eval.Config.EgScaleBishopAdvantagePer128   = Parameters[nameof(EvalConfig.EgScaleBishopAdvantagePer128)].Value;
     eval.Config.EgScaleOppBishopsPerPassedPawn = Parameters[nameof(EvalConfig.EgScaleOppBishopsPerPassedPawn)].Value;
     eval.Config.EgScaleWinningPerPawn          = Parameters[nameof(EvalConfig.EgScaleWinningPerPawn)].Value;
     // Calculate positional factors after updating evaluation config.
     eval.CalculatePositionalFactors();
 }