1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use crate::*;
extern_class!(
/// The Monte Carlo Strategist is a generic AI that selects a game model update for a given player that results
/// in the highest likelihood for that player to eventually win the game. It does this by sampling the updates available
/// to the player in question. In doing this it will select the update it knows to produce the best result so far, expanding on this
/// selection, simulating the rest of the game from that expansion, and then propogating the results (win or loss) upwards.
/// It will do this until the budget has been reached, then returning the choice it has deemed best suited for the player in question.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkmontecarlostrategist?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct GKMonteCarloStrategist;
);
#[cfg(feature = "GKStrategist")]
extern_conformance!(
unsafe impl GKStrategist for GKMonteCarloStrategist {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for GKMonteCarloStrategist {}
);
impl GKMonteCarloStrategist {
extern_methods!(
/// The maximum number of samples that will be processed when searching for a move.
#[unsafe(method(budget))]
#[unsafe(method_family = none)]
pub unsafe fn budget(&self) -> NSUInteger;
/// Setter for [`budget`][Self::budget].
#[unsafe(method(setBudget:))]
#[unsafe(method_family = none)]
pub unsafe fn setBudget(&self, budget: NSUInteger);
/// A weight that encourages exploration of less visited updates versus the continued exploitation of previously visited updates.
#[unsafe(method(explorationParameter))]
#[unsafe(method_family = none)]
pub unsafe fn explorationParameter(&self) -> NSUInteger;
/// Setter for [`explorationParameter`][Self::explorationParameter].
#[unsafe(method(setExplorationParameter:))]
#[unsafe(method_family = none)]
pub unsafe fn setExplorationParameter(&self, exploration_parameter: NSUInteger);
);
}
/// Methods declared on superclass `NSObject`.
impl GKMonteCarloStrategist {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}