Exemple #1
0
        public override void fromValueMap(Dictionary <string, string> vals)
        {
            // FIXME: instead of having multiple functions reading/writing into a value map, automate this


            int evaderCount  = Int32.Parse(vals[GameParamsValueNames.EVADERS_COUNT.key]);
            int pursuerCount = Int32.Parse(vals[GameParamsValueNames.PURSUERS_COUNT.key]);

            r_p = Int32.Parse(vals[GameParamsValueNames.PURSUERS_VELOCITY.key]);

            p_d = double.Parse(
                GameParamsValueNames.PURSUERS_DETECTION_PROB.tryRead(vals));

            canEliminate         = (1 == int.Parse(AdvRoutingGameParamsValueNames.CAN_PURSUERS_ELIMINATE.tryRead(vals)));
            sinkAlwaysDetectable = (1 == int.Parse(AdvRoutingGameParamsValueNames.SINK_ALWAYS_DETECTED.tryRead(vals)));
            accurateInterception = (1 == int.Parse(AdvRoutingGameParamsValueNames.CAN_SENSE_ACCURATE_LOCATION.tryRead(vals)));

            string rewardFuncName = GameParamsValueNames.REWARD_FUNCTION_NAME.tryRead(vals);

            R = ReflectionUtils.constructEmptyCtorType <ARewardFunction>(rewardFuncName);
            R.setArgs(GameParamsValueNames.REWARD_FUNCTION_ARGS.tryRead(vals));

            A_E = Evader.getAgents(evaderCount);
            A_P = Pursuer.getAgents(pursuerCount);

            singleSourceRouter          = "1" == AdvRoutingGameParamsValueNames.SINGLE_SOURCE.tryRead(vals);
            forceContinuousTransmission = "1" == AdvRoutingGameParamsValueNames.CONTINUOUS_ROUTERS.tryRead(vals);
        }
Exemple #2
0
        public override void fromValueMap(Dictionary <string, string> vals)
        {
            int evaderCount  = Int32.Parse(vals[GameParamsValueNames.EVADERS_COUNT.key]);
            int pursuerCount = Int32.Parse(vals[GameParamsValueNames.PURSUERS_COUNT.key]);

            r_p = Int32.Parse(vals[GameParamsValueNames.PURSUERS_VELOCITY.key]);
            r_e = Int32.Parse(vals[GameParamsValueNames.EVADERS_TRANSMISSION_RANGE.key]);
            r_s = Int32.Parse(vals[GameParamsValueNames.EVADERS_SENSING_RANGE.key]);

            p_d = double.Parse(
                GameParamsValueNames.PURSUERS_DETECTION_PROB.tryRead(vals));


            canEvadersReceiveMultipleBroadcasts = (vals[GameParamsValueNames.EVADERS_CAN_RECEIVE_SIMULTENOUS_BROADCASTS.key] == "1");
            canSinksSensePursuers = (vals[GameParamsValueNames.SINKS_SENSE_PURSUERS.key] == "1");
            areSinksSafe          = (vals[GameParamsValueNames.SINKS_SAFE_POINTS.key] == "1");

            EvaderCircumferenceEntranceKillProb = float.Parse(GameParamsValueNames.EVADERS_CIRCUMFERENCE_ENTRY_KILL_PROB.tryRead(vals));

            R = ReflectionUtils.constructEmptyCtorType <ARewardFunction>(vals[GameParamsValueNames.REWARD_FUNCTION_NAME.key]);
            R.setArgs(vals[GameParamsValueNames.REWARD_FUNCTION_ARGS.key]);

            A_E = Evader.getAgents(evaderCount);
            A_P = Pursuer.getAgents(pursuerCount);
        }