public void AllDataSetsInput() { PredictionModel model = new PredictionModel(); PredictionModelInput input = new PredictionModelInput(); input.CWPBN = 30; input.Beams = 4; input.DeploymentDuration = 30; input.CEI = 1.0; input.CED_IsE0000001 = true; input.CED_IsE0000002 = true; input.CED_IsE0000003 = true; input.CED_IsE0000004 = true; input.CED_IsE0000005 = true; input.CED_IsE0000006 = true; input.CED_IsE0000007 = true; input.CED_IsE0000008 = true; input.CED_IsE0000009 = true; input.CED_IsE0000010 = true; input.CED_IsE0000011 = true; input.CED_IsE0000012 = true; input.CED_IsE0000013 = true; input.CED_IsE0000014 = true; input.CED_IsE0000015 = true; double bytes = model.GetDataStorage(input); double correctAnswer = 12172032000; Assert.AreEqual(correctAnswer, bytes); }
public void TurnOffSomeDataSets() { PredictionModel model = new PredictionModel(); int cwpbn = 30; int beam = 4; int deploymentDuration = 30; float cei = 1.0f; bool IsE0000001 = true; bool IsE0000002 = false; bool IsE0000003 = true; bool IsE0000004 = false; bool IsE0000005 = true; bool IsE0000006 = true; bool IsE0000007 = false; bool IsE0000008 = true; bool IsE0000009 = false; bool IsE0000010 = true; bool IsE0000011 = false; bool IsE0000012 = true; bool IsE0000013 = false; bool IsE0000014 = true; bool IsE0000015 = false; double bytes = model.GetDataStorage(cwpbn, beam, deploymentDuration, cei, IsE0000001, IsE0000002, IsE0000003, IsE0000004, IsE0000005, IsE0000006, IsE0000007, IsE0000008, IsE0000009, IsE0000010, IsE0000011, IsE0000012, IsE0000013, IsE0000014, IsE0000015); double correctAnswer = 7153920000; Assert.AreEqual(correctAnswer, bytes); }
/// <summary> /// Setup the predictor. /// </summary> public void CalcPrediction() { if (_pm.SelectedProject.Configuration.SubsystemConfigDict.ContainsKey(ConfigKey)) { PredictionModelInput predInput = new PredictionModelInput(_pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].SubsystemConfig.SubSystem); if (_pm.SelectedProject.Configuration.DeploymentOptions.Duration <= 0) { predInput.DeploymentDuration = 1; } else { predInput.DeploymentDuration = _pm.SelectedProject.Configuration.DeploymentOptions.Duration; } // Absorption predInput.Temperature = _pm.SelectedProject.Configuration.Commands.CWT; predInput.Salinity = _pm.SelectedProject.Configuration.Commands.CWS; predInput.XdcrDepth = _pm.SelectedProject.Configuration.Commands.CTD; predInput.CEI = _pm.SelectedProject.Configuration.Commands.CEI.ToSecondsD(); predInput.CWPON = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CWPON; predInput.CBTON = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CBTON; predInput.CBTTBP = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CBTTBP; predInput.CBTBB_TransmitPulseType = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CBTBB_Mode; //predInput.CBTBB_TransmitPulseType = Commands.AdcpSubsystemCommands.eCBTBB_Mode.NARROWBAND_LONG_RANGE; // DEFAULT to narrowband because it autoswitches now predInput.CWPTBP = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CWPTBP; predInput.CWPBN = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CWPBN; predInput.CWPBS = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CWPBS; predInput.CWPBL = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CWPBL; predInput.CWPBB_TransmitPulseType = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CWPBB_TransmitPulseType; predInput.CWPBB_LagLength = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CWPBB_LagLength; predInput.CWPP = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CWPP; predInput.BatteryType = _pm.SelectedProject.Configuration.DeploymentOptions.BatteryType; predInput.CBI_BurstInterval = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CBI_BurstInterval.ToSecondsD(); predInput.CBI_SamplesPerBurst = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CBI_NumEnsembles; predInput.CBI_IsInterleaved = _pm.SelectedProject.Configuration.SubsystemConfigDict[ConfigKey].Commands.CBI_BurstPairFlag; // Create Prediction model PredictionModel Predictor = new PredictionModel(); // Set the prediction values PredictionModel.PredictedRanges ranges = Predictor.GetPredictedRange(predInput); PredictedBottomRange = ranges.BottomTrack; PredictedProfileRange = ranges.WaterProfile; ProfileFirstBinPosition = ranges.FirstBinPosition.ToString("0.0000"); double maxVel = Predictor.GetMaxVelocity(predInput); MaximumVelocity = maxVel.ToString("0.0000"); double std = Predictor.GetStandardDeviation(predInput); StandardDeviation = std.ToString("0.0000"); double numBatts = Predictor.BatteryUsage(predInput); NumberBatteryPacks = numBatts; if (CBI_NumEnsembles > 0) { NumberBytes = Predictor.GetDataStorageBurst(predInput); } else { NumberBytes = Predictor.GetDataStorage(predInput); } if (RangeVM != null) { // Update all the properites RangeVM.WaterProfileRange = ranges.WaterProfile; RangeVM.BottomTrackRange = ranges.BottomTrack; RangeVM.WpBlank = predInput.CWPBL; RangeVM.WpFirstBinRange = ranges.FirstBinPosition; if (_pm.IsProjectSelected && _pm.SelectedProject.Configuration != null) { RangeVM.DepthToBottom = predInput.XdcrDepth; } } //this.NotifyOfPropertyChange(() => this.CWPP); //this.NotifyOfPropertyChange(() => this.CWPTBP); //this.NotifyOfPropertyChange(() => this.CWPBS); //this.NotifyOfPropertyChange(() => this.CWPBN); //this.NotifyOfPropertyChange(() => this.CWPBL); //this.NotifyOfPropertyChange(() => this.CWPBB_TransmitPulseType); //this.NotifyOfPropertyChange(() => this.CWPBB_LagLength); //this.NotifyOfPropertyChange(() => this.CBTON); //this.NotifyOfPropertyChange(() => this.CBI_BurstInterval); //this.NotifyOfPropertyChange(() => this.DataSize); //this.NotifyOfPropertyChange(() => this.NumberBatteryPackStr); //this.NotifyOfPropertyChange(() => this.PredictedBottomRangeStr); //this.NotifyOfPropertyChange(() => this.PredictedProfileRangeStr); //this.NotifyOfPropertyChange(() => this.ProfileFirstBinPosition); //this.NotifyOfPropertyChange(() => this.MaximumVelocity); //this.NotifyOfPropertyChange(() => this.StandardDeviation); } }