Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
 public MCTSNodeInformedRollout(IAI ai, ISimulationState state, MCTSNodeInformedRollout parent, double explorationConstant) : base(state, parent, explorationConstant)
 {
     this.ai = ai;
 }
Beispiel #4
0
 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;
 }
Beispiel #6
0
 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));
 }
Beispiel #7
0
 public abstract double GetScore(ISimulationState gameState, IPlayer player);
Beispiel #8
0
 public UpdateEventArgs(ISimulationManager simulationManager, ISimulationState sim)
 {
     Manager = simulationManager ?? throw new ArgumentNullException(nameof(simulationManager));
     Sim     = sim ?? throw new ArgumentNullException(nameof(sim));
 }