@Test public void testRapidResponseWithOneSurfarceDriftPoint(){ SAROperation operation = new SAROperation(SAR_TYPE.RAPID_RESPONSE); DateTime now = DateTime.now(); DateTime lastKnowPositionTs = now.minusHours(1); Position lastKnowPosition = Position.create(61, -51); DateTime css = now; double xError = 1.0; double yError = 0.1; double safetyFactor = 1.0; RapidResponseData data = new RapidResponseData("1", lastKnowPositionTs, css, lastKnowPosition, xError, yError, safetyFactor, 0) ; List<SARWeatherData> surfaceDriftData = new ArrayList<>(); surfaceDriftData.add(new SARWeatherData(45.0, 5.0, 15.0, 30.0, lastKnowPositionTs)); data.setWeatherPoints(surfaceDriftData); operation.startRapidResponseCalculations(data); assertEquals("61 03.328N", data.getDatum().getLatitudeAsString()); assertEquals("050 52.939W", data.getDatum().getLongitudeAsString()); assertEquals(45.78003035557367, data.getRdvDirection(), 0.0); assertEquals(4.7754450213160355, data.getRdvDistance(), 0.0); assertEquals(4.7754450213160355, data.getRdvSpeed(), 0.0); assertEquals(2.5326335063948107, data.getRadius(), 0.0); assertEquals("61 06.905N", data.getA().getLatitudeAsString()); assertEquals("050 52.842W", data.getA().getLongitudeAsString()); assertEquals("61 03.278N", data.getB().getLatitudeAsString()); assertEquals("050 45.541W", data.getB().getLongitudeAsString()); assertEquals("60 59.748N", data.getC().getLatitudeAsString()); assertEquals("050 53.043W", data.getC().getLongitudeAsString()); assertEquals("61 03.375N", data.getD().getLatitudeAsString()); assertEquals("051 00.331W", data.getD().getLongitudeAsString()); }
public RapidResponseData startRapidResponseCalculations(RapidResponseData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return rapidResponse(data); }
SAROperation { public RapidResponseData startRapidResponseCalculations(RapidResponseData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return rapidResponse(data); } }
SAROperation { public RapidResponseData startRapidResponseCalculations(RapidResponseData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return rapidResponse(data); } SAROperation(SAR_TYPE operationType); }
SAROperation { public RapidResponseData startRapidResponseCalculations(RapidResponseData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return rapidResponse(data); } SAROperation(SAR_TYPE operationType); DatumLineData startDatumLineCalculations(DatumLineData data); RapidResponseData startRapidResponseCalculations(RapidResponseData data); DatumPointData startDatumPointCalculations(DatumPointData data); List<SARData> sarFutureCalculations(SARData data); DatumPointData datumPoint(DatumPointData data); Position applyDriftToPoint(SARData data, Position point, double timeElapsed); static void findRapidResponseBox(Position datum, double radius, RapidResponseData data); SAR_TYPE getOperationType(); void calculateEffortAllocation(SARData data); }
SAROperation { public RapidResponseData startRapidResponseCalculations(RapidResponseData data) { double difference = (double) (data.getCSSDate().getMillis() - data.getLKPDate().getMillis()) / 60 / 60 / 1000; data.setTimeElasped(difference); return rapidResponse(data); } SAROperation(SAR_TYPE operationType); DatumLineData startDatumLineCalculations(DatumLineData data); RapidResponseData startRapidResponseCalculations(RapidResponseData data); DatumPointData startDatumPointCalculations(DatumPointData data); List<SARData> sarFutureCalculations(SARData data); DatumPointData datumPoint(DatumPointData data); Position applyDriftToPoint(SARData data, Position point, double timeElapsed); static void findRapidResponseBox(Position datum, double radius, RapidResponseData data); SAR_TYPE getOperationType(); void calculateEffortAllocation(SARData data);  }