private List<RobotBase> GeneratePursuers(HomeworkTwo.Point point, Workspace traversabilityMap, Workspace visibilityMap, List<Node> groundPatrolPath) { Workspace airWorkspace = new Workspace(X_MIN, X_MAX, Y_MIN, Y_MAX) { }; airWorkspace.GenerateEvenGraph((UInt16)(X_RANGE + 1), (UInt16)(Y_RANGE + 1)); List<Node> airPatrolPath = new List<Node>() { airWorkspace.GetNode(new HomeworkTwo.Point(1, 39)), airWorkspace.GetNode(new HomeworkTwo.Point(39, 39)), airWorkspace.GetNode(new HomeworkTwo.Point(39, 1)), airWorkspace.GetNode(new HomeworkTwo.Point(1, 1))}; return new List<RobotBase>() { new GroundPursuer(GroundPursuerPatrol.TheInstance, point, // location RADIUS, // radius new Vector2D(), // intial velocity MAX_SPEED * .6f, // max speed new Vector2D(), // intial heading MASS, // mass new Vector2D(1, 1), // scale TURN_RATE, // turn rate MAX_FORCE, // max force groundPatrolPath, // patrol path traversabilityMap, // traversability map visibilityMap),// visibility map new AerialPursuer(AerialPursuerPatrol.TheInstance, new HomeworkTwo.Point(1,15), // location RADIUS, // radius new Vector2D(), // intial velocity MAX_SPEED * .75f, // max speed new Vector2D(), // intial heading MASS, // mass new Vector2D(), // scale TURN_RATE, // turn rate MAX_FORCE, // max force airPatrolPath, // patrol path airWorkspace, // traversability map airWorkspace) }; // visibility map }
private List<Target> GenerateTargets(HomeworkTwo.Point point, Workspace traversabilityMap, Workspace visibilityMap) { // Create our agents return new List<Target>() { new Target(TargetPatrol.TheInstance, point, // location RADIUS, // radius new Vector2D(), // intial velocity MAX_SPEED * .7f, // max speed new Vector2D(), // intial heading MASS, // mass new Vector2D(1.0, 1.0), // scale TURN_RATE, // turn rate MAX_FORCE, // max force new List<Node>(), // patrol path traversabilityMap, // traversability map visibilityMap)}; // visibility map }
private Vector2 ConvertPointToVector2(HomeworkTwo.Point point) { return new Vector2(point.X * (GraphicsDevice.Viewport.Width / X_RANGE), point.Y * (GraphicsDevice.Viewport.Height / Y_RANGE)); }