public override LinguisticInputValue CreateLinguisticInputValue(BoardRepresentation board) { LinguisticInputValue result = new LinguisticInputValue(GetName(), 0); float r = 0.0f; for (int i = 1; i < 25; i++) { if (board.GetPiecesAt(i) == 1) { bool[,] possibleDices = new bool[6, 6]; for (int x = 0; x < 6; x++) { for (int y = 0; y < 6; y++) { possibleDices[x, y] = false; } } for (int j = 0; j < i; j++) { if (board.GetPiecesAt(j) < 0) { CalculateHitProbability(i, j, board, possibleDices); } } int waysToBeHit = 0; for (int x = 0; x < 6; x++) { for (int y = 0; y < 6; y++) { if (possibleDices[x, y]) { waysToBeHit++; } } } float p = (((float)waysToBeHit) / 36.0f) * 100; r += ((24.0f - ((float)i - 1)) / 24.0f) * p; } } if (r > 50.0f) { r = 50.0f; } result.CrispValue = (int)Math.Round(r, 0); return(result); }
public override LinguisticInputValue CreateLinguisticInputValue(BoardRepresentation board) { LinguisticInputValue result = new LinguisticInputValue(GetName(), 0); for (int i = 1; i < 26; i++) { if (board.GetPiecesAt(i) > 0) { result.CrispValue = i; } } return(result); }
public override LinguisticInputValue CreateLinguisticInputValue(BoardRepresentation board) { bool opponentFound = false; LinguisticInputValue result = new LinguisticInputValue(GetName(), 0); for (int i = 0; i < 26; i++) { if (board.GetPiecesAt(i) < 0) { opponentFound = true; } if (board.GetPiecesAt(i) > 0 && opponentFound) { result.CrispValue = 1; break; } } return(result); }
public override LinguisticInputValue CreateLinguisticInputValue(BoardRepresentation board) { int currentConsecutiveOwned = 0; LinguisticInputValue result = new LinguisticInputValue(GetName(), 0); for (int i = 1; i < 25; i++) { if (board.GetPiecesAt(i) > 1) { currentConsecutiveOwned++; if (currentConsecutiveOwned > result.CrispValue) { result.CrispValue = currentConsecutiveOwned; } } else { currentConsecutiveOwned = 0; } } return(result); }
public override LinguisticInputValue CreateLinguisticInputValue(BoardRepresentation board) { LinguisticInputValue result = new LinguisticInputValue(GetName(), 0); int ownPips = 0; for (int i = 0; i < 26; i++) { if (board.GetPiecesAt(i) > 0) { ownPips += i * board.GetPiecesAt(i); } } int opponentPips = 0; for (int i = 0; i < 26; i++) { if (board.GetPiecesAt(i) < 0) { opponentPips += (25 - i) * (-board.GetPiecesAt(i)); } } int r = opponentPips - ownPips; if (r > 50) { r = 50; } if (r < -50) { r = -50; } result.CrispValue = r; return(result); }
public override LinguisticInputValue CreateLinguisticInputValue(BoardRepresentation board) { LinguisticInputValue result = new LinguisticInputValue(GetName(), board.BearOffCountCurrent()); return(result); }
public override LinguisticInputValue CreateLinguisticInputValue(BoardRepresentation board) { LinguisticInputValue result = new LinguisticInputValue(GetName(), -board.GetPiecesAt(0)); return(result); }