private List <string> addBlockReaction(List <string> fuzzyRules, CurrentFrameData frameData1, CurrentFrameData frameData2, string reaction, int frequency, bool obeyHitType) { string hitTypeString = ""; if (obeyHitType) { if (reaction == AIReaction.StandBlock) { hitTypeString = AIRule.Rule_AND; hitTypeString += AIRule.Rule_Open_Parenthesis; hitTypeString += AICondition.Attacking_HitType_Opponent + AIRule.Rule_IS + AIRule.Rule_NOT + HitType.Low; hitTypeString += AIRule.Rule_AND + AICondition.Attacking_HitType_Opponent + AIRule.Rule_IS + AIRule.Rule_NOT + HitType.Sweep; hitTypeString += AIRule.Rule_Close_Parenthesis; } else if (reaction == AIReaction.CrouchBlock) { hitTypeString = AIRule.Rule_AND; hitTypeString += AIRule.Rule_Open_Parenthesis; hitTypeString += AICondition.Attacking_HitType_Opponent + AIRule.Rule_IS + AIRule.Rule_NOT + HitType.Overhead; hitTypeString += AIRule.Rule_AND + AICondition.Attacking_HitType_Opponent + AIRule.Rule_IS + AIRule.Rule_NOT + HitType.HighKnockdown; hitTypeString += AIRule.Rule_Close_Parenthesis; } } fuzzyRules.Add( AIRule.Rule_IF + AICondition.Attacking_Opponent + AIRule.Rule_IS + AIBoolean.TRUE + hitTypeString + AIRule.Rule_AND + AIRule.Rule_Open_Parenthesis + AICondition.Attacking_FrameData_Opponent + AIRule.Rule_IS + frameData1 + AIRule.Rule_OR + AICondition.Attacking_FrameData_Opponent + AIRule.Rule_IS + frameData2 + AIRule.Rule_Close_Parenthesis + AIRule.Rule_THEN + reaction + AIRule.Rule_IS + GetDesirabilityValue(frequency) ); return(fuzzyRules); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); font = Content.Load <SpriteFont>("defaultFont"); // Use the name of your sprite font file here instead of 'Score'. UIConsole.GlobalConsole.Font = font; UIConsole.GlobalConsole.Position = new Vector2(20, GraphicsDevice.Viewport.Height - UIConsole.GlobalConsole.MaxHeight - 20); cfd = new CurrentFrameData(font); cfd.Position = new Vector2(20, 20); cons = new Constellation(GraphicsDevice, font); cons.Position = new Vector2(400, 20); cons.Size = new Vector2(180, 180); satelliteBusyLed = new UILed(GraphicsDevice, font); heartBeatLed = new UILed(GraphicsDevice, font); statisticsSocketLed = new UILed(GraphicsDevice, font); dataSocketLed = new UILed(GraphicsDevice, font); frameLockLed = new UILed(GraphicsDevice, font); int firstLed = 260; satelliteBusyLed.Position = new Vector2(20, firstLed); satelliteBusyLed.Text = "Satellite Busy"; heartBeatLed.Position = new Vector2(20, firstLed + 30); heartBeatLed.Text = "Heart Beat"; statisticsSocketLed.Text = "Statistics Connected"; statisticsSocketLed.Position = new Vector2(20, firstLed + 60); dataSocketLed.Text = "Data Connected"; dataSocketLed.Position = new Vector2(20, firstLed + 90); frameLockLed.Text = "Frame Lock"; frameLockLed.Position = new Vector2(20, firstLed + 120); Texture2D mouseCursor = Content.Load <Texture2D>("arrow"); cursor = new MouseCursor(mouseCursor); }
private List <string> addBlockReaction(List <string> fuzzyRules, CurrentFrameData frameData1, string reaction, int frequency) { fuzzyRules.Add( AIRule.Rule_IF + AICondition.Attacking_Opponent + AIRule.Rule_IS + AIBoolean.TRUE + AIRule.Rule_AND + AICondition.Attacking_FrameData_Opponent + AIRule.Rule_IS + frameData1 + AIRule.Rule_THEN + reaction + AIRule.Rule_IS + GetDesirabilityValue(frequency) ); return(fuzzyRules); }
private List<string> addBlockReaction(List<string> fuzzyRules, CurrentFrameData frameData1, CurrentFrameData frameData2, string reaction, int frequency, bool obeyHitType) { string hitTypeString = ""; if (obeyHitType){ if (reaction == AIReaction.StandBlock){ hitTypeString = AIRule.Rule_AND; hitTypeString += AIRule.Rule_Open_Parenthesis; hitTypeString += AICondition.Attacking_HitType_Opponent + AIRule.Rule_IS + AIRule.Rule_NOT + HitType.Low; hitTypeString += AIRule.Rule_AND + AICondition.Attacking_HitType_Opponent + AIRule.Rule_IS + AIRule.Rule_NOT + HitType.Sweep; hitTypeString += AIRule.Rule_Close_Parenthesis; }else if (reaction == AIReaction.CrouchBlock){ hitTypeString = AIRule.Rule_AND; hitTypeString += AIRule.Rule_Open_Parenthesis; hitTypeString += AICondition.Attacking_HitType_Opponent + AIRule.Rule_IS + AIRule.Rule_NOT + HitType.Overhead; hitTypeString += AIRule.Rule_AND + AICondition.Attacking_HitType_Opponent + AIRule.Rule_IS + AIRule.Rule_NOT + HitType.HighKnockdown; hitTypeString += AIRule.Rule_Close_Parenthesis; } } fuzzyRules.Add( AIRule.Rule_IF + AICondition.Attacking_Opponent + AIRule.Rule_IS + AIBoolean.TRUE + hitTypeString + AIRule.Rule_AND + AIRule.Rule_Open_Parenthesis + AICondition.Attacking_FrameData_Opponent + AIRule.Rule_IS + frameData1 + AIRule.Rule_OR + AICondition.Attacking_FrameData_Opponent + AIRule.Rule_IS + frameData2 + AIRule.Rule_Close_Parenthesis + AIRule.Rule_THEN + reaction + AIRule.Rule_IS + GetDesirabilityValue(frequency) ); return fuzzyRules; }
private List<string> addBlockReaction(List<string> fuzzyRules, CurrentFrameData frameData1, string reaction, int frequency) { fuzzyRules.Add( AIRule.Rule_IF + AICondition.Attacking_Opponent + AIRule.Rule_IS + AIBoolean.TRUE + AIRule.Rule_AND + AICondition.Attacking_FrameData_Opponent + AIRule.Rule_IS + frameData1 + AIRule.Rule_THEN + reaction + AIRule.Rule_IS + GetDesirabilityValue(frequency) ); return fuzzyRules; }
public Main() { #region Create Config File config.RecordIntermediateFile = config.RecordIntermediateFile; config.ChannelDataServerName = config.ChannelDataServerName; config.ChannelDataServerPort = config.ChannelDataServerPort; config.ConstellationServerName = config.ConstellationServerName; config.ConstellationServerPort = config.ConstellationServerPort; config.StatisticsServerName = config.StatisticsServerName; config.StatisticsServerPort = config.StatisticsServerPort; config.EnableDCS = config.EnableDCS; config.EnableEMWIN = config.EnableEMWIN; config.EraseFilesAfterGeneratingFalseColor = config.EraseFilesAfterGeneratingFalseColor; config.GenerateFDFalseColor = config.GenerateFDFalseColor; config.GenerateNHFalseColor = config.GenerateNHFalseColor; config.GenerateSHFalseColor = config.GenerateSHFalseColor; config.GenerateUSFalseColor = config.GenerateUSFalseColor; config.GenerateXXFalseColor = config.GenerateXXFalseColor; config.HTTPPort = config.HTTPPort; config.GenerateInfraredImages = config.GenerateInfraredImages; config.GenerateVisibleImages = config.GenerateVisibleImages; config.GenerateWaterVapourImages = config.GenerateWaterVapourImages; config.MaxGenerateRetry = config.MaxGenerateRetry; config.SysLogServer = config.SysLogServer; config.SysLogFacility = config.SysLogFacility; config.UseNOAAFormat = config.UseNOAAFormat; config.EnableWeatherData = config.EnableWeatherData; config.TemporaryFileFolder = config.TemporaryFileFolder; config.FinalFileFolder = config.FinalFileFolder; config.Save(); #endregion graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; cfd = null; graphics.PreferredBackBufferWidth = 1280; graphics.PreferredBackBufferHeight = 720; graphics.PreferMultiSampling = true; this.Exiting += (object sender, EventArgs e) => { //cn.Stop(); }; FileHandler.SkipEMWIN = !config.EnableEMWIN; FileHandler.SkipDCS = !config.EnableDCS; FileHandler.SkipWeatherData = !config.EnableWeatherData; if (config.TemporaryFileFolder != null) { if (!LLTools.TestFolderAccess(config.TemporaryFileFolder)) { UIConsole.GlobalConsole.Error($"Cannot write file to Temporary Folder {config.TemporaryFileFolder}"); throw new ApplicationException($"Cannot write file to Temporary Folder {config.TemporaryFileFolder}"); } FileHandler.TemporaryFileFolder = config.TemporaryFileFolder; } if (config.FinalFileFolder != null) { if (!LLTools.TestFolderAccess(config.FinalFileFolder)) { UIConsole.GlobalConsole.Error($"Cannot write file to Final Folder {config.FinalFileFolder}"); throw new ApplicationException($"Cannot write file to Final Folder {config.FinalFileFolder}"); } FileHandler.FinalFileFolder = config.FinalFileFolder; } ImageManager.EraseFiles = config.EraseFilesAfterGeneratingFalseColor; ImageManager.GenerateInfrared = config.GenerateInfraredImages; ImageManager.GenerateVisible = config.GenerateVisibleImages; ImageManager.GenerateWaterVapour = config.GenerateWaterVapourImages; ImageManager.MaxRetryCount = config.MaxGenerateRetry; ImageManager.UseNOAAFileFormat = config.UseNOAAFormat; Connector.ChannelDataServerName = config.ChannelDataServerName; Connector.StatisticsServerName = config.StatisticsServerName; Connector.ConstellationServerName = config.ConstellationServerName; Connector.ChannelDataServerPort = config.ChannelDataServerPort; Connector.StatisticsServerPort = config.StatisticsServerPort; Connector.ConstellationServerPort = config.ConstellationServerPort; if (LLTools.IsLinux) { SyslogClient.SysLogServerIp = config.SysLogServer; try { SyslogClient.Send(new Message(config.SysLogFacility, Level.Information, "Your syslog connection is working! OpenSatelliteProject is enabled to send logs.")); } catch (SocketException) { UIConsole.GlobalConsole.Warn("Your syslog is not enabled to receive UDP request. Please refer to https://opensatelliteproject.github.io/OpenSatelliteProject/"); } } string fdFolder = PacketManager.GetFolderByProduct(NOAAProductID.GOES13_ABI, (int)ScannerSubProduct.INFRARED_FULLDISK); string xxFolder = PacketManager.GetFolderByProduct(NOAAProductID.GOES13_ABI, (int)ScannerSubProduct.INFRARED_AREA_OF_INTEREST); string nhFolder = PacketManager.GetFolderByProduct(NOAAProductID.GOES13_ABI, (int)ScannerSubProduct.INFRARED_NORTHERN); string shFolder = PacketManager.GetFolderByProduct(NOAAProductID.GOES13_ABI, (int)ScannerSubProduct.INFRARED_SOUTHERN); string usFolder = PacketManager.GetFolderByProduct(NOAAProductID.GOES13_ABI, (int)ScannerSubProduct.INFRARED_UNITEDSTATES); string fmFolder = PacketManager.GetFolderByProduct(NOAAProductID.GOES16_ABI, (int)ScannerSubProduct.NONE); FDImageManager = new ImageManager(fdFolder); XXImageManager = new ImageManager(xxFolder); NHImageManager = new ImageManager(nhFolder); SHImageManager = new ImageManager(shFolder); USImageManager = new ImageManager(usFolder); FMImageManager = new ImageManager(fmFolder); }
internal void AddResult(NUISkeleton filtered) { CurrentFrameData.Add("Result", filtered); }
internal void AddMapped(NUISkeleton mapped) { CurrentFrameData.Add("Mapped", mapped); }
internal void AddFiltered(string name, NUISkeleton filtered) { CurrentFrameData.Add(name, filtered); }