Beispiel #1
0
        public override bool init(AGameGraph G, IntrusionGameParams Prm,
                                  APursuersPolicy initializedPursuers,
                                  UI.IPolicyGUIInputProvider Pgui,
                                  Dictionary <string, string> policyParams = null)
        {
            this.g              = (GridGameGraph)G;
            this.prm            = (IntrusionGameParams)Prm;
            this.pgui           = Pgui;
            this.activeStrategy = ((PPDPatrol)initializedPursuers).ActiveStrategy;


            //if (pgui.hasBoardGUI())
            //    policyParams.AddRange(argNames, pgui.ShowDialog(argNames.ToArray(), "StraightForwardIntruderPolicy init", null));

            //delayBetweenIntrusions = int.Parse(
            //    Utils.ParsingUtils.readValueOrDefault(
            //        policyParams,
            //        AppConstants.Policies.StraightForwardIntruderPolicy.DELAY_BETWEEN_INTRUSIONS,
            //        AppConstants.Policies.StraightForwardIntruderPolicy.DELAY_BETWEEN_INTRUSIONS_DEFAULT));


            Point target = g.getNodesByType(NodeType.Target).First();

            //Point topRight = target.subtruct(prm.r_e / 2, prm.r_e / 2);
            sensitiveArea = prm.SensitiveAreaSquare(target); //new GameLogic.Utils.Grid4Square(topRight, prm.r_e-1);
            myRand        = new ThreadSafeRandom().rand;
            return(prm.IsAreaSquare);
        }
Beispiel #2
0
 public override bool init(AGameGraph G, IntrusionGameParams prm, IPolicyGUIInputProvider gui, Dictionary <string, string> policyInput)
 {
     this.g    = (GridGameGraph)G;
     this.gm   = prm;
     this.pgui = gui;
     //foreach (Pursuer p in gm.A_P)
     //  currentPursuersLocations[p] = null;
     intrusionCenterPoint = g.getNodesByType(NodeType.Target).First();
     return(true);
 }
Beispiel #3
0
        public void addGUIMarks(List <GameLogic.Utils.PursuerPathObservation> O_p,
                                IPolicyGUIInputProvider ui,
                                IntrusionGameState s,
                                GridGameGraph gr,
                                IntrusionGameParams prm,
                                Dictionary <Evader, Point> currentEvaderLocations)
        {
            if (ui.hasBoardGUI())
            {
                Dictionary <string, List <Point> > markedLocations = new Dictionary <string, List <Point> >();

                List <Point> tmpPointList = new List <Point>();
                foreach (var p in O_p)
                {
                    tmpPointList.AddRange(p.observedPursuerPath);
                }
                markedLocations.Add("Pursuer trail(O_p)", tmpPointList);

                tmpPointList = new List <Point>();
                foreach (var p in O_p)
                {
                    tmpPointList.Add(p.observedPursuerPath.Last());
                }
                markedLocations.Add("Pursuer last pos", tmpPointList);

                List <Point> detectionArea = new List <Point>();
                foreach (Evader e in s.ActiveEvaders)
                {
                    if (currentEvaderLocations.ContainsKey(e))
                    {
                        detectionArea.AddRange(
                            gr.getNodesWithinDistance(currentEvaderLocations[e], prm.r_es));
                    }
                }
                markedLocations.Add("Area within r_s(evaders detecting pursuers)", detectionArea);

                ui.markLocations(markedLocations.toPointFMarkings());
            }
        }
Beispiel #4
0
        public override bool init(AGameGraph G, IntrusionGameParams prmi, APursuersPolicy initializedPursuers, IPolicyGUIInputProvider pGui, Dictionary <string, string> policyParams = null)
        {
            IntrusionGameParams prm = prmi;

            this.accumObservationsPerEve = new Dictionary <Evader, List <GameLogic.Utils.PursuerPathObservation> >();
            foreach (var e in prm.A_E)
            {
                this.accumObservationsPerEve[e] = new List <GameLogic.Utils.PursuerPathObservation>();
            }

            this.nextEvadersToCommunicate = new List <Evader>();
            this.g    = (GridGameGraph)G;
            this.gm   = prm;
            this.pgui = pGui;
            foreach (Evader e in gm.A_E)
            {
                currentEvadersLocations[e] = new Location(Location.Type.Unset);
            }

            intrusionAreaCenter = g.getNodesByType(NodeType.Target).First();
            return(true);
        }
Beispiel #5
0
        public override bool init(AGameGraph G, IGameParams prm, IPolicyGUIInputProvider pgui, Dictionary <string, string> policyParams)
        {
            IntrusionGameParams concreateParam = (IntrusionGameParams)prm;

            return(init(G, concreateParam, pgui, policyParams));
        }
Beispiel #6
0
 public abstract bool init(AGameGraph G, IntrusionGameParams prm, IPolicyGUIInputProvider pgui, Dictionary <string, string> policyParams);
Beispiel #7
0
 public abstract bool init(AGameGraph G, IntrusionGameParams prm, APursuersPolicy initializedPursuers, IPolicyGUIInputProvider pgui, Dictionary <string, string> policyParams = null);