public override double GetScore(ISimulationState gameState, IPlayer player) { double score = 0; double mainWeight; int weightIndex; weightIndex = Math.Min(mainWeights.Length - 1, player.Congresses); mainWeight = mainWeights[weightIndex].Value; score += mainWeight; // remaining weeks in a year score += mainWeight * subWeights[0].Value * Normalize(Time.weeksInAYear - player.Time.CurrentWeek, 0, 52, 0, 1); // years left score += mainWeight * subWeights[1].Value * Normalize(Time.finalYear - player.Time.CurrentYear, 0, Time.finalYear - Time.firstYear + 1, 0, 1); return(score); }
public FileSystemController( IMainScreen mainScreen, ICanControlTargetConnection targetConnection, ICanControlTargetFileSystem targetFileSystem, ICanLogData dataLogManager, ISimulationState simulationState) { // Register needed models and views MainScreen = mainScreen; TargetConnection = targetConnection; TargetFileSystem = targetFileSystem; DataLogManager = dataLogManager; SimulationState = simulationState; // Subscribe to events MainScreen.LoadModelToggleButtonClicked += new MouseEventHandler(HandleLoadModelToggleButtonClicked); MainScreen.UseLogTimeCheckboxChanged += new EventHandler <UseLogTimeChangedEventArgs>(HandleUseLogTimeCheckboxChecked); MainScreen.UserEnteredLoggingTime += new EventHandler <LogTimeChangedEventArgs>(HandleUserEnteredLoggingTIme); MainScreen.StartLoggingToggleButtonClicked += new EventHandler(HandleStartLoggingToggleButtonClicked); TargetConnection.TargetConnectionStateChanged += new EventHandler <TargetConnectionStateChangedEventArgs>(HandleTargetConnectionStateChanged); }
public MCTSNodeInformedRollout(IAI ai, ISimulationState state, MCTSNodeInformedRollout parent, double explorationConstant) : base(state, parent, explorationConstant) { this.ai = ai; }
public MCTSNodeCutoff(ISimulationState state, MCTSNode parent) : base(state, parent) { }
/// <summary> /// Initializes a new instance of the <see cref="LoadStateEventArgs"/> class. /// </summary> /// <param name="state">The state.</param> public LoadStateEventArgs(ISimulationState state) { State = state; }
public override double GetScore(ISimulationState gameState, IPlayer player) { // weeks left * weight return(mainWeights[0].Value * Normalize(player.Time.RemainingWeeks(), 0, TotalWeeks(gameState.Game), 0, 1)); }
public abstract double GetScore(ISimulationState gameState, IPlayer player);
public UpdateEventArgs(ISimulationManager simulationManager, ISimulationState sim) { Manager = simulationManager ?? throw new ArgumentNullException(nameof(simulationManager)); Sim = sim ?? throw new ArgumentNullException(nameof(sim)); }