Class GKMinmaxStrategist

  • All Implemented Interfaces:
    GKStrategist, NSObject

    public class GKMinmaxStrategist
    extends NSObject
    implements GKStrategist
    The Minmax Strategist is a generic AI that selects a game model update for a given player that maximises potential gain, while minimising potential loss. It does this by examining all of the updates available to the player in question, extrapolating the potential moves opposing players may take, projecting out maxLookAheadDepth number of turns. The selected update will result in the greatest potential gain, balanced against the potential gain of other players.
    • Constructor Detail

      • GKMinmaxStrategist

        protected GKMinmaxStrategist​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • description_static

        public static java.lang.String description_static()
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • bestMoveForPlayer

        public GKGameModelUpdate bestMoveForPlayer​(GKGameModelPlayer player)
        Selects the best move for the specified player. If randomSource is not nil, it will randomly select which move to use if there are one or more ties for the best. Returns nil if the player is invalid, the player is not a part of the game model, or the player has no valid moves available.
      • maxLookAheadDepth

        public long maxLookAheadDepth()
        The maximum number of future turns that will be processed when searching for a move.
      • randomMoveForPlayerFromNumberOfBestMoves

        public GKGameModelUpdate randomMoveForPlayerFromNumberOfBestMoves​(GKGameModelPlayer player,
                                                                          long numMovesToConsider)
        Selects one move from the set of N best moves for the specified player, where N is equal to numMovesToConsider. If randomSource is nil, it will not randomly select, but will behave like bestMoveForPlayer and return the first best move. Returns nil if the player is invalid, the player is not a part of the game model, or the player has no valid moves available.
      • randomSource

        public GKRandom randomSource()
        Description copied from interface: GKStrategist
        A random source to use when breaking ties between equally-strong moves when calling bestMoveForPlayer or when selecting a random move when randomMoveForPlayer is called. If set to nil, bestMoveForPlayer and randomMoveForPlayer will simply return the first best move available.
        Specified by:
        randomSource in interface GKStrategist
      • setMaxLookAheadDepth

        public void setMaxLookAheadDepth​(long value)
        The maximum number of future turns that will be processed when searching for a move.
      • setRandomSource

        public void setRandomSource​(GKRandom value)
        Description copied from interface: GKStrategist
        A random source to use when breaking ties between equally-strong moves when calling bestMoveForPlayer or when selecting a random move when randomMoveForPlayer is called. If set to nil, bestMoveForPlayer and randomMoveForPlayer will simply return the first best move available.
        Specified by:
        setRandomSource in interface GKStrategist