public TacticLayer(WorldModel worldModel, LowLevelLayer lowLevel) { actionSelectionStrategy = new FuzzyActionSelectionStrategy(worldModel); WM = worldModel; lowLevelLayer = lowLevel; mLogger = Logger.Logger.Instance; internalState = ModuleState.Inactive; Hashtable consts = WM.GetConstants(); currentActionDirective = new ActionDirective(AHEntities.Action.LEAVE, DateTime.Now); //PlanningScheduler = new OnDemandActionPlanningSchedulingStrategy(0.02, currentActionDirective, lowLevel); PlanningScheduler = new PeriodicActionPlanningSchedulingStrategy((double)consts["PlanPeriod"], currentActionDirective, lowLevel); }
public LowLevelLayer(Communicator.Communicator com, WorldModel worldModel, double timeStep, short degrees) { internalState = ModuleState.Inactive; communicator = com; WM = worldModel; DOF = degrees; Ts = timeStep; mLogger = Logger.Logger.Instance; planTime = new Stopwatch(); planTime.Reset(); Hashtable consts = WM.GetConstants(); maxTime = (double)consts["MoveInterval"]; commandsQueue = new TrajectoryQueue(DOF, new double[2] { -1000, 0 }); bounderyConditions = new PointParams(); //motionGuidanceStrategy = new OpenLoopMotionGuidanceStrategy(commandsQueue, com, Ts); motionGuidanceStrategy = new PDMotionGuidanceStrategy(commandsQueue, com, Ts, WM); actionPlanningStrategy = new SimpleLinesActionPlanningStrategy(WM); trajectoryPlanningStrategy = new PolynomialTrajectoryPlanningStrategy(Ts, maxTime); // dummy planning to warm up the containers #region Warmup /* * PointParams init = new PointParams(); * init.AddParameters(new Point(0, 0)); * init.AddParameters(new Point(0, 0)); * init.T = DateTime.Now; * //init.T = 0; * PointParams final = new PointParams(); * final.AddParameters(new Point(0, 0)); * final.AddParameters(new Point(0, 0)); * final.T = DateTime.Now + TimeSpan.FromSeconds(0.2); * state = WM.GetPhysicalState(); * actionPlanningStrategy.ActionPlanning(AHEntities.Action.DEFENSE_ATTACK, true); * trajectoryPlanningStrategy.TrajectoryPlanning(init, final); */ #endregion Warmup }
public FuzzyActionSelectionStrategy(WorldModel worldModel) { WM = worldModel; global = worldModel.GetConstants(); }
public SimpleEstimationStrategy(WorldModel worldModel) { global = worldModel.GetConstants(); }