Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public MCTSNodeInformedRollout(IAI ai, ISimulationState state, MCTSNodeInformedRollout parent, double explorationConstant) : base(state, parent, explorationConstant)
 {
     this.ai = ai;
 }
Exemplo n.º 4
0
 public MCTSNodeCutoff(ISimulationState state, MCTSNode parent) : base(state, parent)
 {
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LoadStateEventArgs"/> class.
 /// </summary>
 /// <param name="state">The state.</param>
 public LoadStateEventArgs(ISimulationState state)
 {
     State = state;
 }
Exemplo n.º 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));
 }
Exemplo n.º 7
0
 public abstract double GetScore(ISimulationState gameState, IPlayer player);
Exemplo n.º 8
0
 public UpdateEventArgs(ISimulationManager simulationManager, ISimulationState sim)
 {
     Manager = simulationManager ?? throw new ArgumentNullException(nameof(simulationManager));
     Sim     = sim ?? throw new ArgumentNullException(nameof(sim));
 }